Understanding Schedules and Long-Running Jobs

What happens when a scheduled job runs longer than the scheduled interval time period?

Brian Moran

November 19, 2001

1 Min Read
ITPro Today logo in a gray background | ITPro Today

What happens when a scheduled job runs longer than the scheduled interval time period? For example, if a job is scheduled to execute every 10 minutes and takes 35 minutes to complete, does the job execute again while it's still running?

On the SQL Server Most Valuable Professional (MVP) newsgroup, a private forum for SQL Server MVPs, Microsoft published two design facts about the SQL Server Agent that can help answer this question. First, the SQL Server Agent runs only one instance of a job at a time. Second, the SQL Server Agent calculates the Next Run Date at the end of the job. So, if a job execution takes longer than its scheduled interval, the job will rerun at the next recurrence point. For example, imagine that Job A is scheduled with a 1-minute recurrence interval. Job A starts at 1:25 p.m. and runs for 1 minute 45 seconds. Job A is still running at 1:26, when the next scheduled recurrence should happen, and the SQL Server Agent will run only one instance of a job at a time—so nothing happens at 1:26 p.m. When Job A ends at 1:26:45 p.m., the SQL Server Agent resets the Next Run Date. Based on the specified 1-minute recurrence interval, the next time the job will run is 1:27 p.m.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like