April 4, 2006 at 9:01 am
I have a SQL job that runs every minute. The last step of the job is set to "Quit with success" if it succeeds, and "Quit with failure" if it fails. I also have it set up to email me if it fails. The only problem is that when it fails, the job continues to try and run it every minute. Therefore I sometimes when I come to work in the morning, my inbox is full of emails. Is there any way to disable the job if it fails?
Thanks,
Scott
April 4, 2006 at 10:09 am
Try adding an additional step but leave on Success of the current last step as quit with success. Change on fail to goto next step then create a step to disable the job. Then use sp_update_job (see bol) to disable the job and set on success and failure to quit job reporting failure.
April 4, 2006 at 10:31 am
Great idea, thanks a mill.
April 6, 2006 at 3:28 pm
Check to see if you have it set to Retry (on the advanced tab of the Step). If so, set retry attempts to 0.
April 6, 2006 at 6:39 pm
I do believe retry is an immediate retry and has nothing to do with starting a job. All of my jobs are set to 0 and whn fails continue to run.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply