Will a SQL Server Job skip a scheduled run if it is already running?
Solution 1
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
I'm pretty sure it will skip it if it is running.
Solution 3
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.
Sam Schutte
President of Unstoppable Software, Inc., a custom software development shop that focuses on building solutions for healthcare, engineering, and industrial companies. Our ability to "bolt on" to your team to deliver solutions on-time and on-budget set us apart from a the herd of staff aug consultants that it's your problem to manage. Reach out to us at 513-382-8499 if you'd like to learn more about how we engage for incredible ROI, or read the case studies below to learn just how great that ROI can be: Inspection Fines Management System: 4000% ROI over two years Automated Patient Diagnostics System/EMR: 50%+ productivity and $200,000 annual audit risk reduction Sales Enablement Through Automated CAD Design: 1,000% ROI through lead time reduction from 2 weeks to 5 minutes If you're not ready to engage for a full project, check out some of our micro-engagements which can deliver incredible value in a very short time: Micro Engagements [email protected]
Updated on July 05, 2022Comments
-
Sam Schutte almost 2 years
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?
-
Daniel T. over 14 yearsAwesome, that's exactly what I wanted to know. I have an e-mail checker that sometimes takes a while to download large e-mails. Because it runs every minute, it's -very- important that a second instance of the job isn't started if the first one hasn't completed yet.
-
Paul almost 8 yearsI was contemplating doing this- but it seemed easier to google it and.. voila
-
Ivan Rascon almost 7 yearsIs there any way to achieve this, I mean avoid the skip and start another instance of the job? Or just could be done creating another SQL Job? Thanks
-
arcee123 almost 6 years@Jose, question. I don't want SQL server saying it's a fault or error. Just skipped. how can I ensure that is so? Thanks