1

Can I set up a SQL Server agent job to run the same job continuously as soon as the previous instance is completed or after 5 minutes (whichever is higher)? I'm using SQL Server 2012.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
that_me123
  • 61
  • 3
  • 10
  • I think if a SQL Agent job is running and you attempt to run it again (either manually or via a schedule), [it won't run a second instance of the job](http://stackoverflow.com/questions/865042/will-a-sql-server-job-skip-a-scheduled-run-if-it-is-already-running). So just set up a 5 min schedule for your job and let it roll. – Dave Mason Aug 19 '15 at 19:09
  • Does it throw up an error if it re-runs when a previous instance is running? – that_me123 Aug 19 '15 at 19:10
  • You'll see an entry in the SQL log similar to this: `[000] Request to run job (from User acme\jdoe) refused because the job already has a pending request from User acme\jdoe`. If you if right-click the SQL Agent job in SSMS and view the job history, you won't see an entry for when the job attempted to run but did not. – Dave Mason Aug 19 '15 at 19:21

0 Answers0