Search code examples
sqlsql-servervariablesssisexecute-sql-task

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)


Solution

  • 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.