Will a SQL Server Job skip a scheduled run if it is already running?

SqlSql ServerScheduled TasksSql Server-Agent

Sql Problem Overview


If you schedule a SQL Server job to run every X number of minutes, and it does not finish the previous call before the # of minutes is up, will it skip the run since it is already running, or will it run two instances of the job doing the same steps?

Sql Solutions


Solution 1 - Sql

The SQL Server agent checks whether the job is already running before starting a new iteration. If you have long running job and its schedule comes up, it would be skipped until the next interval.

You can try this for yourself. If you try to start a job that's already running, you will get an error to that effect.

Solution 2 - Sql

I'm pretty sure it will skip it if it is running.

Solution 3 - Sql

Which version of SQL Server are you using? This seems like a pretty easy thing to test. Set up a job with a WAITFOR in it that inserts a single row into a table and set up the job to run twice in quick succession (shorter than the WAITFOR DELAY).

When running such a test in SQL Server 2005 it skipped the run that was overlapped.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSam SchutteView Question on Stackoverflow
Solution 1 - SqlJose BasilioView Answer on Stackoverflow
Solution 2 - SqlPQWView Answer on Stackoverflow
Solution 3 - SqlTom HView Answer on Stackoverflow