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.
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.
Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this
If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.