dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

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


Home > Database Forum > Microsoft SQL Server > sqlserver-dts > Passing variable to DTS from Stored Proc.

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 11-14-2008, 11:59 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Passing variable to DTS from Stored Proc.

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 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
Reply With Quote
  #2  
Old 11-14-2008, 12:50 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: Passing variable to DTS from Stored Proc.

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
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 07:03 PM.