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
 SQL Server Development (2000)
 How do I execute a DTS Package in a stored procedure?

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-23 : 09:05:43
Sree writes "Hi There;

I am trying to write a stored procedure in which I might need to execute a DTS package, if available and I want to proceed based on the success result of DTS package execution. I wonde, if there is any way of doing this.

Thank you,
-- Sree"

M.E.
Aged Yak Warrior

539 Posts

Posted - 2002-05-23 : 10:37:35
I'm not sure as to why exactly you'd be doing this.

From the quick bit of research my answer would be no... They are seperate entities along side of the databases.Unless theres something new in sql 2k that wasn't in 7.0, I don't think it's possible. Once again, why?

I'd suggest putting this stored proc at the end of the dts package and, upon success of all steps prior, have it run this stored proc.

Go to Top of Page

sakheb
Starting Member

4 Posts

Posted - 2002-05-23 : 11:10:37
It could be done. check this link
http://www.swynk.com/friends/green/dtsole.asp
It tells you exactly how to execute a DTS package through a stored procedure.
Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-05-23 : 11:15:29
Yikes . . . SQLDMO is one way to go, but if it were me, I'd xp_cmdshell out to dtsrun.exe and check the return code from xp_cmdshell for success/failure . . . either that or pump the output of xp_cmdshell into a table and search the table for some keyword like 'error' . . .

<O>
Go to Top of Page

M.E.
Aged Yak Warrior

539 Posts

Posted - 2002-05-23 : 11:27:16
DTS grew up alot from 7.0 to 2000 didn't it?

Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-05-23 : 11:36:18
quote:

DTS grew up alot from 7.0 to 2000 didn't it?



it did, but you can do this using my suggestion or the sqldmo route in 7 . . .

<O>
Go to Top of Page
   

- Advertisement -