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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 job rerun
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

8 Posts

Posted - 10/14/2012 :  01:51:04  Show Profile  Reply with Quote
i have a job which i need to rerun only after it completes. below is the code i have written for it.

exec dbo.Main_SMS_Procedure
if @@error = 0
WAITFOR DELAY ''000:00:10''

but thats not whats happening the job does not wait till it is over and reruns it self again after 10 sec delay.

would appriciate if i could have a solution for the job to rerun only when it complete or fails.

Flowing Fount of Yak Knowledge

United Kingdom
2157 Posts

Posted - 10/14/2012 :  12:17:08  Show Profile  Visit jackv's Homepage  Reply with Quote
You could use the SQL Server Agent as a real time scheduler . There is potential for sub minute scheduling - and therefore you can use the buitin fail\success workflow logic. You'll notice on the GUI you can't set up in sub minute - check this link for instruactions http://www.sqlserver-dba.com/2012/01/sql-agent-jobs-schedule-in-seconds.html

How are you running the code you've sent?

Jack Vamvas
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