Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Help regarding SQL Server Agent Jobs

Author  Topic 

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-11-25 : 07:58:02
Hi All,
Iam new to SQL server Agent Jobs scheduling....
How to stop the next attempt of job running when ever it succeds...

Clearly, I have once job scheduled to run on every day houlry basis.
1) Created job steps and
Steps --> create step --> Advanced tab
--> On success action quit the job
Retry attempts 2 with no interval
2) schedules -->Recurring schedule type, daily frequency is set to run for every 1 hour in a day


Now my problem is that how to stop the recurring attempts whenever the job succeds....





--
Chandu

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-25 : 09:33:11
for that you need to have a status control table which will log each run of job in beginning and mark the execution status in the end. Each time check the status in this for the job and continue with next step (actual job steps) only if the last run was a failure.
You may also use sysjobhistory syatem table but might need some transformation on field value to get clarity on the output thats why i usually created my customised version of table with more clearer information.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-11-26 : 03:58:33
thank you visakh

--
Chandu
Go to Top of Page

mdn143
Starting Member

4 Posts

Posted - 2013-11-26 : 07:36:06
The step will be retried only if it gets failed. If it gets succeeded, it wont retry. Please refer the following link:
http://technet.microsoft.com/en-us/library/aa215218(v=sql.80).aspx

Regards,
Dhamu
Go to Top of Page
   

- Advertisement -