jlnorsworthy
jlnorsworthy

Reputation: 3974

SSIS - Pass values from a T-Sql task to a data flow task

I am looking to output a scalar value from a T-SQL task (select max(ID) from...) and use that to pull data from another server. I am sure I can write a script task to retrieve that value into a variable and use it in the data flow task, but it seems that there should be a simpler way.

Any suggestions?

Update:

In addition to billinkc's answer, I found this tutorial which was very helpful:

http://sqlfool.com/2009/08/getting-started-with-variables-in-ssis/

Upvotes: 2

Views: 9039

Answers (1)

billinkc
billinkc

Reputation: 61211

Parameterize your query like so to use the value you saved off from the Execute SQL task.

enter image description here

Set parameters here.

enter image description here

Upvotes: 3

Related Questions