Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Call DTS Using a Stored Procedure

Author  Topic 

petek
Posting Yak Master

192 Posts

Posted - 2008-07-25 : 07:20:50
Hi All,

I have not come across yet and it may be a easy question for you, but how do i call a DTS package from a stored procedure.

Kind Regards

Pete.

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2008-07-25 : 12:21:51
You can use xp_cmdshell to call the DTSRUN ... check out books online for DTSRUN..

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-07-26 : 18:47:08
Another way is create a sql job for the package and run it with msdb..sp_start_job in sp.
Go to Top of Page

petek
Posting Yak Master

192 Posts

Posted - 2008-07-28 : 09:25:32
thankyou that was great.

Kind Regards

Pete.
Go to Top of Page

petek
Posting Yak Master

192 Posts

Posted - 2008-08-06 : 07:18:35
Hi all,

i am trying to run:

declare
@cmd nvarchar(1000),
@servername nvarchar(20)
set @servername=@@servername

set @cmd='dtsrun /S'+@servername+' /GrandfatherRights_ExportDataFromHoldingTable /EMicrosoft OLE DB Provider for SQL Server'

exec master..xp-cmdshell @cmd, no_output

but get the following error:

Server: Msg 170, Level 15, State 1, Line 8
Line 8: Incorrect syntax near 'cmdshell'.


Kind Regards

Pete.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-08-06 : 08:18:26
xp-cmdshell should be xp_cmdshell

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -