Passing variable to DTS from Stored Proc. - sqlserver-dts
This is a discussion on Passing variable to DTS from Stored Proc. - sqlserver-dts ; I have been following Darren Green's excellent article on executing DTS packages from SPs... I am stuck now though, I have everything working great, except that I cannot pass a variable from the SP to the DTS package, When I ...
![]() |
| | LinkBack | Thread Tools | Display Modes |
|
#1
| |||
| |||
| DTS packages from SPs... I am stuck now though, I have everything working great, except that I cannot pass a variable from the SP to the DTS package, When I set the GlobalV_1 var on execute, I am only able to hardcode the value in there, instead of using a variable from the SP. @GlobalV_1='VariableName=VariableValue' I tried this, @GlobalV_1='gOldEmpID=' + @OldEmpID + '' But this returns a "Line 1: Incorrect syntax near '+'." error. How can I use my variables to pass to the DTS? Thanks, Drew |
|
#2
| |||
| |||
|
I figured this out. I needed to declare 2 new variables and build them and use them as the variable to pass, For example, SET @OldEmpID = 'xx381281' SET @Global_OldEmpID = 'gOldEmpID=' + @OldEmpID @GlobalV_1=@Global_OldEmpID That works perfectly. Thanks, Drew |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
All times are GMT -4. The time now is 07:03 PM.




Linear Mode