简体   繁体   中英

Return single row single value result set of Execute SQL task as an input to another execute SQL task in SSIS

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)

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.

Your question can be divided into 2 parts:

  1. 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:

  2. 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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM