Paramerters on DataFlow Task

  • I have a scenario , where I need to fetch data from Database 1 (on Server 1) and insert into Database 2( on Server 2) on a particular condition.

    I am using SSIS 2008.

    1)First I fetched an ID from Database2 using ExecuteSqlQuery.

    2)I then used the ID from step 1 and fetched a set of rows from Database1 again using another ExecuteSqlQuery

    3) I now want to insert these fetched rows back into Database2.

    I guess I should probably use a for each .

    But.... I now feel that it is better that I use a Data flow task in

    step 2 .

    I know there is a way to pass parameters(id) using executesqlquery , but I cannot find a way to pass the the output of the execute sql task as an input to the data flow task . Is it possible ? Is there a better way to do what I am trying to achieve ? Please let me know.

    Thanks,

    SA

  • sameerarjuna (2/26/2013)


    I have a scenario , where I need to fetch data from Database 1 (on Server 1) and insert into Database 2( on Server 2) on a particular condition.

    I am using SSIS 2008.

    1)First I fetched an ID from Database2 using ExecuteSqlQuery.

    2)I then used the ID from step 1 and fetched a set of rows from Database1 again using another ExecuteSqlQuery

    3) I now want to insert these fetched rows back into Database2.

    I guess I should probably use a for each .

    But.... I now feel that it is better that I use a Data flow task in

    step 2 .

    I know there is a way to pass parameters(id) using executesqlquery , but I cannot find a way to pass the the output of the execute sql task as an input to the data flow task . Is it possible ? Is there a better way to do what I am trying to achieve ? Please let me know.

    Thanks,

    SA

    Your step (2) needs to change.

    Add a dataflow task and a suitable OLE DB source component.

    Change your data access mode to 'SQL Command' and type in your query, mapping your ID as a parameter.

    You now have the rows you wanted, retrieved as the first part of your dataflow.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Great ! Thank you !

    I did as you said !

    Works for me !

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply