ssisppt

Embed Size (px)

Citation preview

  • 8/13/2019 ssisppt

    1/28

  • 8/13/2019 ssisppt

    2/28

    Import eport wi"ard

    $pening Selecting data Source

    data source * source of data fromwhere !ou want to pull the data

    server name * name of thecomputer

    database select a db and click net

  • 8/13/2019 ssisppt

    3/28

    Selecting destination

    destination * where u want to pushthe data to a data provider or (flatfile#ecel#.so on.. )

    sever name*

    database *

    and click on net

    +rowse to the file destination

    select format and click on netwhich opens the below window

  • 8/13/2019 ssisppt

    4/28

  • 8/13/2019 ssisppt

    5/28

    $pening using management studio

    /ollow the process to open

    Select import to import data intodatabase or eport to eport fromdatabase

  • 8/13/2019 ssisppt

    6/28

    +usiness intelligence development studio(+I0S)

    Bsiness Intelligence !evelopment Stdio(BI!S) is the former I01from Microsoft# and wasused to develop data anal!sis and +usiness Intelligencesolutions utili"ing the Microsoft SQL Server

    nal!sis Services# 'eporting Servicesand Integration Services. It is based on theMicrosoft 2isual Studiodevelopment environment# but customi"ed with the SQL Server services3specific etensions and pro4ect t!pes# including tools# controls and pro4ects for reports# 1TLdataflows# $L% cubesand data miningstructure.

    $pening a new ssis pro4ect * file new pro4ect select business intelligence pro4ects integration services pro4ect. give a name to the pro4ect and location where it has to be storedclick on net. under the solution eplorer !ou can see the new package with etension

    .dts(data transfer services eecutable)

    %ackage * package is collection of tasks and precedence constraints5

    http://var/www/wiki/Integrated_Development_Environmenthttp://var/www/wiki/Microsofthttp://var/www/wiki/Business_Intelligencehttp://var/www/wiki/Microsoft_SQL_Serverhttp://var/www/wiki/SQL_Server_Analysis_Serviceshttp://var/www/wiki/SQL_Server_Reporting_Serviceshttp://var/www/wiki/SQL_Server_Integration_Serviceshttp://var/www/wiki/Microsoft_Visual_Studiohttp://var/www/wiki/Extract,_transform,_loadhttp://var/www/wiki/OLAP_cubehttp://var/www/wiki/Data_mininghttp://var/www/wiki/Data_mininghttp://var/www/wiki/OLAP_cubehttp://var/www/wiki/Extract,_transform,_loadhttp://var/www/wiki/Microsoft_Visual_Studiohttp://var/www/wiki/SQL_Server_Integration_Serviceshttp://var/www/wiki/SQL_Server_Reporting_Serviceshttp://var/www/wiki/SQL_Server_Analysis_Serviceshttp://var/www/wiki/Microsoft_SQL_Serverhttp://var/www/wiki/Business_Intelligencehttp://var/www/wiki/Microsofthttp://var/www/wiki/Integrated_Development_Environment
  • 8/13/2019 ssisppt

    7/28

    0ifference between data flow tasks and control flow tasks

    -ontrol flow *-ontrol flow is where !ou define operations and order ofeecution of those operations. for eample !ou put two operations* eecute t3s&lcommand on a database and send mail. then !ou define order of them with%recedence -onstraint for eample the t3s&l statement should be eecuted and then ifit succeeded mail will be send.

    !ata flow "0ata flow is where !ou define data stream5 where data comes from(data sources)# how data should be transformed (transformations) and where data

    should be loaded (data destinations). !ou can pass data from a component to anothercomponents with 0ata %aths.

    TS6S

  • 8/13/2019 ssisppt

    8/28

    TS6S Task * task is a individual unit of work having a functionalit!

    %recedence constraints tells the order,flow in which tasks are to be eecuted

    Integration Services includes the following t!pes of tasks.

    !ata #low $as% "The task that runs data flows to etract data# appl! column leveltransformations# and load data.

    !ata &reparation $as%s*These tasks do the following processes* cop! files and directories5download files and data5 run 7eb methods5 appl! operations to 8ML documents5 and profiledata for cleansing.

    'or%flow $as%s "The tasks that communicate with other processes to run packages# runprograms or batch files# send and receive messages between packages# send e3mailmessages# read 7indows Management Instrumentation (7MI) data# and watch for 7MIevents.

    SQL Server $as%s "The tasks that access# cop!# insert# delete# and modif! SQL Serverob4ects and data.

    Scripting $as%s"The tasks that etend package functionalit! b! using scripts.

    nalysis Services $as%s "The tasks that create# modif!# delete# and process nal!sisServices ob4ects.

    Maintenance $as%s "$he tasks that perform administrative functions such as backing upand shrinking SQL Server databases# rebuilding and reorgani"ing indees# and running SQL

    Server gent 4obs.

  • 8/13/2019 ssisppt

    9/28

  • 8/13/2019 ssisppt

    10/28

    1ecute s&l task

    In connection t!pe we can set differentt!pes of connections like *ado.net etc...

  • 8/13/2019 ssisppt

    11/28

    9et the feel of it

  • 8/13/2019 ssisppt

    12/28

    9etting data from ecel sheets -reate two tables emp:a#emp:b

    with same no of cols in the ecelsheet

    $pen microsoft ssis integrationpro4ect and name it as importecel

    'ight click properties debugigng

    set run ;< bit to false Take a se&uence container and a

    data flow task in the se&uencecontainer

    0eclare two variables =)ecelpath

    datat!pe to string and value ise&ual to the path in which thefolder is present >) table datat!peto string and value is e&ual toemp:a

  • 8/13/2019 ssisppt

    13/28

    9o to data flow task properties to dela!validation to true

    ?ow select a ecel source in dataflowtasks under properties set validate

    eternal metadata to false Start configuring the ecel source b!

    right click edit under connectionmanager new browse choose theecel sheet path folder under natureof the ecel sheet select sheet=

    7atch cloumns column mappings tocheck @meaning dont mess with itA

    -lick on connection manager underpropert! select ecel file path underepression choose the user definedvariable @Buser**ecelpath A

    ?ow come to destination select oledbdestination and under properties selectvalidate eternal meta data to false

  • 8/13/2019 ssisppt

    14/28

    9etting value from a table and enumerating it through foreach container

    Take variable #name it @tableA andchoose datat!pe as ob4ect @we canselect n no of rows and colsA

    In connection set the connection

    *if its local host set

    localhost.databasename In the s&l statement write the

    corresponding s&l statement*@select Cfrom tablnameA

    In order to capture the result from setresult set to full result set

    ?ow go the result set and and setresult name to D and variable name touser**table

  • 8/13/2019 ssisppt

    15/28

    Take for each loop container and add itto eecute s&l task

    ?ow take four more variables likecit!:name cit!:desc#!ear#t:population@userdefinedA

    ?ow we will capture the column b!column in for each loop container

    Select the for each loop container rightclick it to go to collection

    In for each loop editor enumeratorselect for each ado.enumerator

    Ender ob4ect ado enumerator selectthe variable * user *table

    Select rows in the first table and ok

    ?ow goto variable mappings and selectall the variables cit!:namecit!:desc#!ear#t:population@userdefinedA and u cansee the indes as D#=#>#F respectivel!@ifwe want onl! one column data we canchose onl! one columnA

    ?ow take a data flow task

  • 8/13/2019 ssisppt

    16/28

    ?ow take a data flow task

    Inside the data flow taskselect oledb source

    Ender oledb select localhost.databasename and ok

    Ender s&l command test write start = asrows

    ?ow add a derived coloumn to the data flowtask

    In derived column in the derived columnname set four variablesc:name#c:des#c:!ear #c:population andunder epression add the four user definedvariables #@u can see the length to D sounder t!pe casting use dt:str length GHD#codename =>H>A ! 0ont ask !s....J

    ?ow add a row count @data transformationA itcounts the no of rows take one morevariable as row count and add to custom

    variable in row count

    9 tti d t i l t t bl i i d ti it th h

  • 8/13/2019 ssisppt

    17/28

    9etting data in ecel to a table in ssis and enumerating it through aforeach container

    =) take a variable b! name it.@tableA $0/ data t!pe ob4ect.

    Take a eecute s&l task

    Set the connection

  • 8/13/2019 ssisppt

    18/28

    Ender evaluatio operation !ouhave four operations *

    constraint #epression#constraint orepression#constraint andepression.

    There are three constraints *

    success#failure#completion

    The star marked task has twopaths

    under such case select one ofthese

    -onstraint editor

  • 8/13/2019 ssisppt

    19/28

    -reating variables 'ight click on the empt! space

    variables

    dd variable to add a new variable

    if !ou select on the empt! spacethe scope will be package level ifselect a particular task the scopewill be task level

    !efining a variable"

    B@user ** variableA GG KvalueK

    -lick on test to check if its a valid

    variable

  • 8/13/2019 ssisppt

    20/28

    containers -ontainers* containers are

    used to group a task into

    logical units 0efault container is task host

    container

    There are basicall! three

    containers *=)for loop >) for eachF)se&uence container

    Ender construction

  • 8/13/2019 ssisppt

    21/28

    0ata flow tasks

    -onnection managers* connection manager

    is a pointer to thesource or destinationconnection

    0ata sources

    0ata source viewsEnder construction

  • 8/13/2019 ssisppt

    22/28

    -onnections*

    Microsoft SQL Server Integration Services packages use connections to perform differenttasks and to implement Integration Services features*

    -onnecting to source and destination data stores such as tet# 8ML# 1cel

    workbooks# and relational databases to etract and load data. -onnecting to relational databases that contain reference data to perform eact or

    fu""! look ups.

    -onnecting to relational databases to run SQL statements such as S1L1-T#

    01L1T1# and I?S1'T commands and also stored procedures.

    -onnecting to SQL Server to perform maintenance and transfer tasks such as

    backing up databases and transferring logins. 7riting log entries in tet and 8ML files and SQL Server tables and package

    configurations to SQL Server tables.

    -onnecting to SQL Server to create temporar! work tables that some

    transformations re&uire to do their work.

    -onnecting to nal!sis Services pro4ects and databases to access data mining

    models# process cubes and dimensions# and run 00L code.

    Specif!ing eisting or creating new files and folders to use with /oreach Loop

    enumerators and tasks.

    -onnecting to message &ueues and to 7indows Management Instrumentation

    (7MI)# SQL Server Management $b4ects (SM$)# 7eb# and mail servers.

    - ti

  • 8/13/2019 ssisppt

    23/28

    -onnection managershttp*,,technet.microsoft.com,en3us,librar!,ccHDH;D.asp

  • 8/13/2019 ssisppt

    24/28

  • 8/13/2019 ssisppt

    25/28

    +usiness Intelligence

  • 8/13/2019 ssisppt

    26/28

    +usiness Intelligence

    Slowl! changing dimension transformation

    /u""! Look up /u""! 9rouping

    Term 1traction

    Term look up

    0ata mining Quer!

    0QS -leansing

  • 8/13/2019 ssisppt

    27/28

  • 8/13/2019 ssisppt

    28/28