![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |