April 20, 2007 at 2:54 pm
Hi
Inside my old school DTS...
I have a Connection to DB1.
I have an "Execute SQL Task" the statement is Execute sp_Bob @FName = 'Bob'
I have an "Dynamic Properties Task" in which I have created a global variable, gvFName with a value of "Bob"
I want the EST Statemtent to use the value of gvFName (obviously).
In the DPT I have played with with everything but no luck.
Can someone please, for the love of God, tell me what I need to do to get this to work.
Possibly some combination of manipluating the DPT and Statement itself.
April 20, 2007 at 3:28 pm
in the execute sql task, use sp_Bob @Fname = ?
may need to name the parameter if that isn't your only global variable.
I think the syntax would be sp_Bob @FName = ?gvFname
you will want to double check that second statement though, it's been a while since I used that syntax
April 20, 2007 at 4:48 pm
Hi
Right on man, thanks a ton.
The first statement worked, the second did not.
"sp_Bob @FName = ?" works
"sp_Bob @FName = ?gvFName" does not work
Now I remember how happy I was to go to SSIS.
Out of curiosity, does anyone know what to do if you have more than 1 param?
April 23, 2007 at 3:31 am
More parameters means more ?'s. For example, if sp_Bob had two input parameters you would write:
sp_Bob ?, ?
Then you can map the parameters to GlobalVariables in the same way. In this case they would be listed as Parameter 1 and, unsurprisingly, Parameter 2.
April 23, 2007 at 5:45 am
How does it know what order gvOne and gvTWO should be placed in in the statement?
sp_Bob ? (gvTWO),? (gvOne)
April 23, 2007 at 5:49 am
It works on the principle of first in, first out. When you click on the Parameters button and assign the variables, the first ? will map to Parameter 1, the second to 2 and so on...
April 23, 2007 at 5:51 am
Paramters button?
FIFO - that's weak but expected.
Thanks
April 23, 2007 at 6:15 am
The Parameters button is one of the available buttons in the Execute Sql Task Properties dialog. Here you can map both input and output parameters.
Check out BOL for a (maybe) better description of the Execute sql task under Contents > Data Transformation Services > DTS Package Elements > DTS Tasks > Tasks that Copy and Manage Data.
April 23, 2007 at 6:17 am
Thanks again.
April 23, 2007 at 6:29 am
No probs. It just struck me, there's a good explanation of parameters at http://www.sqldts.com/234.aspx, a site that has been (and continues to be) very useful.
Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply