Groups | Blog | Home
all groups > sql server dts > april 2007 >

sql server dts : Executing dtsrun from a store procedure


BigO
4/13/2007 10:28:01 AM
I am trying to execute a DTS Package from within a stored procedure,
however the Execute statement hangs while running the debugger.
The sql is EXECUTE @SP_Return = master.dbo.xp_cmdshell 'DTSRun /E /
SBIGO /NPFW Data Load', NO_OUTPUT

The debugger hangs, SQL Query Analyser does not respond after exiting
the debugger and MSSQLSERVER needs to be stopped & Restarted.

The DTS Packages runs fine from the cmd prompt as can be seen below

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Greg>DTSRun /E /SBIGO /NPFW Data Load
DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: Copy Data from PFWDataLoad to [Bistro Group].[dbo].
[tblPFW_Monthly_Load_Data] Step
DTSRun OnProgress: Copy Data from PFWDataLoad to [Bistro Group].[dbo].
[tblPFW_Monthly_Load_Data]
Step; 500 Rows have been transformed or copied.; PercentComple te = 0;
ProgressCount = 500
DTSRun OnFinish: Copy Data from PFWDataLoad to [Bistro Group].[dbo].
[tblPFW_Mon
thly_Load_Data] Step
DTSRun: Package execution complete.

C:\Documents and Settings\Greg>

EXECUTE @SP_Return = master.dbo.xp_cmdshell 'DTSRun /E /SBIGO /NPFW
Data Load', NO_OUTPUT

Any help would be great.
Bulent Gucuk
4/13/2007 7:06:01 PM
EXEC Master..xp_cmdshell 'DTSRUN /S ServerName /E /N PackageName'
I think because you have not left space between the switch and the value.
Try and post back whether it works or not.

Good day,
Bulent

[quoted text, click to view]
BigO
4/14/2007 10:25:12 AM
On Apr 13, 7:06 pm, Bulent Gucuk
[quoted text, click to view]

Thanks Bulent for your reply, unfortuantely I've tried that and it
does not work. However, when I setup a job to execute the stored
procedure it works without hanging. So I've just commentted out the
call to xp_cmdshell and have had to execute the dts package manually
in order to keep testing the rest of the stored procedure.
AddThis Social Bookmark Button