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

If you plan to run the SQL Server job every X minutes, and it does not end the previous call before the number of minutes has elapsed, will it skip the run because it is already running, or will it run two instances of the job to perform the same steps?

+48
sql sql-server scheduled-tasks sql-server-agent
May 14 '09 at 18:47
source share
3 answers

SQL Server Agent checks if the job is running before a new iteration begins. If you have a long-running job and its schedule is suitable, it will be skipped until the next interval.

You can try it for yourself. If you try to start an already running job, you will receive an error message.

+60
May 14 '09 at 19:11
source share

I am sure that he will skip it if it is running.

+3
May 14 '09 at 18:49
source share

What version of SQL Server are you using? This seems like a pretty easy check. Customize the job with WAITFOR, which inserts one row into the table and sets the job to run twice in a row (shorter than WAITFOR DELAY).

When performing such a test in SQL Server 2005, it missed a run that was overridden.

+2
May 14, '09 at 19:15
source share



All Articles