Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Paramerters on DataFlow Task


Paramerters on DataFlow Task

Author
Message
SqlServerNinja
SqlServerNinja
Valued Member
Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)

Group: General Forum Members
Points: 58 Visits: 197
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
Phil Parkin
Phil Parkin
SSCrazy Eights
SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)SSCrazy Eights (8.3K reputation)

Group: General Forum Members
Points: 8322 Visits: 19470
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.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

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.
SqlServerNinja
SqlServerNinja
Valued Member
Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)

Group: General Forum Members
Points: 58 Visits: 197
Great ! Thank you !
I did as you said !
Works for me !
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search