SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Help regarding SQL Server Agent Jobs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 11/25/2013 :  07:58:02  Show Profile  Reply with Quote
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

India
52325 Posts

Posted - 11/25/2013 :  09:33:11  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 11/26/2013 :  03:58:33  Show Profile  Reply with Quote
thank you visakh

--
Chandu
Go to Top of Page

mdn143
Starting Member

India
4 Posts

Posted - 11/26/2013 :  07:36:06  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000