Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call DTS from Sproc and pass in a global variable

Status
Not open for further replies.

rodeomount

Programmer
Sep 25, 2007
50
US
I have a DTS package where I'm using a Global Variable in the where clause of the query for retrieving a record from the source. How can I call this from a sproc and pass in a value for the global variable?
 
I ended up clicking start/Run and pasted the following in "dtsrunui" and clicked OK. First select the server where your DTS packages is. This option is in the lower half, it says "Server". Then select the package name from the top button with the ellipse. Then click on Advanced. Type in the name of the global variable you created in the text box up top. Then Click the Generate Button. The grayed out text box next to the "generate" button will contain the string you need to place behind the following statement inside you sproc:

exec master..xp_cmdshell 'Your string'

be sure to enclose the string inside single quotes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top