Reputation: 75
I need to pass the single value result of an execute SQL task as the input to another. I need to have to separate tasks since I need 2 different connections. (both SQL Server, but different environments)
Upvotes: 3
Views: 2929
Reputation: 37313
Your question can be divided into 2 parts:
Passing the Execute SQL Task result into a variable: You can refer to the following articles to learn more about how to use ResultSets to store an Execute SQL Task result into SSIS variables:
Passing the variable as parameter for another Execute SQL Task: You can refer to the following articles to learn more about passing parameters to Execute SQL Task:
Upvotes: 3
Reputation: 375
Ok simple. First create a variable for the value you want to pass.
Then in your execute sql task, write the query that brings up that value. Make sure to set the result set to single row.
Then go to the variables tab and add your new variable in there.
Once that's done, go to your next task, and in the parameters section add your variable there. I'm assuming both tasks are sql tasks.
Then in the query for the second task use a ? Symbol to represent the variable.
Let me know if that makes sense. I can post screenshots tonight.
Upvotes: 2