Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 633
Sam Schutte Avatar asked May 14 '09 18:05

Sam Schutte


People also ask

Is a job can be created to run a SQL query run one or more time?

Jobs. A job is a specified series of actions that SQL Server Agent performs. Use jobs to define an administrative task that can be run one or more times and monitored for success or failure. A job can run on one local server or on multiple remote servers.

How does SQL Server scheduler work?

Expand SQL Server Agent, expand Jobs, right-click the job you want to schedule, and click Properties. Select the Schedules page, and then click New. In the Name box, type a name for the new schedule. Clear the Enabled check box if you do not want the schedule to take effect immediately following its creation.


2 Answers

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.

like image 138
Jose Basilio Avatar answered Oct 11 '22 02:10

Jose Basilio


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

like image 35
PQW Avatar answered Oct 11 '22 02:10

PQW