dbTalk Databases Forums  

Suppress errors in DTS SQL Task

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


Discuss Suppress errors in DTS SQL Task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kevin Thomas
 
Posts: n/a

Default Suppress errors in DTS SQL Task - 08-08-2003 , 04:28 PM






Hi. I have the following line of code in at sql task in my DTS package:
msdb.dbo.sp_start_job @job_name='myJob'

If this line returns an error (as it will if the job is already running) I
would like to ignore the error and keep the package going. As it is, the
entire task will fail if this one line fails. Is there a way to turn off
errors or ignore an error that arises?

Thanks,

Kevin



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

Default Re: Suppress errors in DTS SQL Task - 08-10-2003 , 04:06 PM






In article <eMiLUQfXDHA.2592 (AT) TK2MSFTNGP09 (DOT) phx.gbl>, Kevin Thomas
<NOSPAMKevinRobertThomas2000 (AT) NOSPAMhotmail (DOT) com> writes
Quote:
Hi. I have the following line of code in at sql task in my DTS package:
msdb.dbo.sp_start_job @job_name='myJob'

If this line returns an error (as it will if the job is already running) I
would like to ignore the error and keep the package going. As it is, the
entire task will fail if this one line fails. Is there a way to turn off
errors or ignore an error that arises?

Thanks,

Kevin

The entire package will only fail immediately if you have set the
package property "Fail on first error" on. Assuming this option is off
you could use an On Complete workflow to your next task to keep going.

Alternatively you could query the job status and see if it is running
already, and only if it is idle, then call sp_start_job. This would be
my preferred method as any other unexpected errors will still be visible
to you.

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




Reply With Quote
  #3  
Old   
Kevin Thomas
 
Posts: n/a

Default Re: Suppress errors in DTS SQL Task - 08-13-2003 , 04:35 PM



Thanks Darren,


Kevin


"Darren Green" <darren.green (AT) reply-to-newsgroup-only (DOT) uk.com> wrote in
message news:rz6uFQJrPrN$Ew7+@sqldts.com...
Quote:
In article <eMiLUQfXDHA.2592 (AT) TK2MSFTNGP09 (DOT) phx.gbl>, Kevin Thomas
NOSPAMKevinRobertThomas2000 (AT) NOS...mail (DOT) com> writes
Hi. I have the following line of code in at sql task in my DTS package:
msdb.dbo.sp_start_job @job_name='myJob'

If this line returns an error (as it will if the job is already running)
I
would like to ignore the error and keep the package going. As it is, the
entire task will fail if this one line fails. Is there a way to turn off
errors or ignore an error that arises?

Thanks,

Kevin


The entire package will only fail immediately if you have set the
package property "Fail on first error" on. Assuming this option is off
you could use an On Complete workflow to your next task to keep going.

Alternatively you could query the job status and see if it is running
already, and only if it is idle, then call sp_start_job. This would be
my preferred method as any other unexpected errors will still be visible
to you.

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





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.