dbTalk Databases Forums  

Validating DTS Return Code Within Stored Proc

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Validating DTS Return Code Within Stored Proc in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joel Ewald
 
Posts: n/a

Default Validating DTS Return Code Within Stored Proc - 10-10-2003 , 01:37 PM






I currently have a stored proc that calls many functions.

One of them is running a DTS job that will transform data
from a sql DB to an output file.

I use the following line of code in the stored proc.

EXEC @Result =
master..xp_cmdshell "DTSRun /SSQLCLUST /Usa /Psa /NDTS_Orde
rDetailAttach", NO_OUTPUT

When this runs I can see that the DTS job completes
successfully. However, @Result never gets set to
successful.


I know in a SQL job you have the option to say on success
or on failure do <action>. So there must be a way to
evaluate wether the DTS was successful or not.

Any Ideas on how I can determine the Return status of the
DTS job?

Thank you.


Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Validating DTS Return Code Within Stored Proc - 10-13-2003 , 01:21 PM






In article <02f101c38f5d$8f4f1140$a101280a (AT) phx (DOT) gbl>, Joel Ewald
<joel.ewald (AT) logisysinc (DOT) com> writes
Quote:
I currently have a stored proc that calls many functions.

One of them is running a DTS job that will transform data
from a sql DB to an output file.

I use the following line of code in the stored proc.

EXEC @Result =
master..xp_cmdshell "DTSRun /SSQLCLUST /Usa /Psa /NDTS_Orde
rDetailAttach", NO_OUTPUT

When this runs I can see that the DTS job completes
successfully. However, @Result never gets set to
successful.


I know in a SQL job you have the option to say on success
or on failure do <action>. So there must be a way to
evaluate wether the DTS was successful or not.

Any Ideas on how I can determine the Return status of the
DTS job?

Thank you.
I would dump the contents into a table, and then check that

CREATE TABLE #DTS (Result varchar(8000) NULL)

INSERT #DTS
EXEC xp_cmdshell 'DTSRUN...'

Now query #DTS for failure text and such like.

--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
  #3  
Old   
Joel Ewald
 
Posts: n/a

Default Re: Validating DTS Return Code Within Stored Proc - 10-14-2003 , 10:13 AM



Thanks

that is the work around I had already put in place.

Just thought there might be a better way either using some
kind of dta global output variable or extended stored proc
command.



Reply With Quote
  #4  
Old   
Darren Green
 
Posts: n/a

Default Re: Validating DTS Return Code Within Stored Proc - 10-16-2003 , 10:51 AM



You could use the sp_OA stored procedures as this will allows you to get the
error info from each step.


--
Darren Green
http://www.sqldts.com

"Joel Ewald" <joel.ewald (AT) logisysinc (DOT) com> wrote

Quote:
Thanks

that is the work around I had already put in place.

Just thought there might be a better way either using some
kind of dta global output variable or extended stored proc
command.





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.