dbTalk Databases Forums  

Passing variable to DTS from Stored Proc.

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Passing variable to DTS from Stored Proc. in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joe
 
Posts: n/a

Default Passing variable to DTS from Stored Proc. - 11-14-2008 , 09:59 AM






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   
Joe
 
Posts: n/a

Default Re: Passing variable to DTS from Stored Proc. - 11-14-2008 , 10:50 AM






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
  #3  
Old   
Joe
 
Posts: n/a

Default Re: Passing variable to DTS from Stored Proc. - 11-14-2008 , 10:50 AM



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
  #4  
Old   
Joe
 
Posts: n/a

Default Re: Passing variable to DTS from Stored Proc. - 11-14-2008 , 10:50 AM



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
  #5  
Old   
Joe
 
Posts: n/a

Default Re: Passing variable to DTS from Stored Proc. - 11-14-2008 , 10:50 AM



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
  #6  
Old   
Joe
 
Posts: n/a

Default Re: Passing variable to DTS from Stored Proc. - 11-14-2008 , 10:50 AM



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
  #7  
Old   
Joe
 
Posts: n/a

Default Re: Passing variable to DTS from Stored Proc. - 11-14-2008 , 10:50 AM



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
  #8  
Old   
Joe
 
Posts: n/a

Default Re: Passing variable to DTS from Stored Proc. - 11-14-2008 , 10:50 AM



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
  #9  
Old   
Joe
 
Posts: n/a

Default Re: Passing variable to DTS from Stored Proc. - 11-14-2008 , 10:50 AM



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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.