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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS call from a stored procedure

Status
Not open for further replies.

netcashin

Programmer
Nov 13, 2000
159
US
I am looking for the simplest way to call a DTS package from
a stored procedure. It is a simple DTS package with no parameters to pass.
 
You can use xp_cmdshell to invoke DTSRUN.EXE. For the parameters to pass to DTSRUN, schedule the DTS job, then open the SQL Agent's properties for it and look at the command line it uses (it will include the package ID needed). The scheduling is only for the purposes of seeing how SQL Agent handles it. Robert Bradley
teaser.jpg

 
Thanks for the advice, but I am getting an error. Here is the code that I used in my stored procedure.

EXEC master..xp_cmdshell 'dtsrun /Skcsql /Ujdoe /Spassword /NDTS_Sophie /H6991EF63-397D-11D5-998C-00E0296DF3E0 /V7991EF64-397D-11D5-998C-00E0296DF3E0 /RChamp'


Here is the error I received. Any ideas?


DTSRun: Loading...

Error: -2147217390 (80041012); Provider Error: 0 (0)

Error string: [Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionOpen (CreateFile()).

Error source:

Help file:

Help context: 0
 
Does this DTS package run alright when invoked manually?

It looks like an unrelated communications issue. Using the Client Network Utility, set the client machine to use TCP/IP instead of the default Named Pipes and see if that helps. Robert Bradley
teaser.jpg

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top