Solved

Sceduled SQL Jobs

Posted on 2011-03-04
2
296 Views
Last Modified: 2012-05-11
I have a job that runs every 15 minutes from midnight to 11:59 PM. Is there a way I can have it not run between 10:00 PM and 10:15 PM.

So it would run between midnight then stop at 9:59 PM and don’t start until 10:16 PM.

The server is scheduled to do a restart and I don’t what it to interrupt the scheduled job
0
Comment
Question by:rjackmanwyn
2 Comments
 
LVL 40

Accepted Solution

by:
Sharath earned 500 total points
ID: 35041369
One approach is create two jobs and name them as EnableJob and DisableJob.
Enable both the jobs and schedule the DisableJob to run once a day at 09:59:00PM.
Schedule the EnableJob to run once a day at 10:15:00PM.
Add this step to DisableJob.
UPDATE MSDB.dbo.sysjobs SET Enabled = 0 WHERE name = 'Your_Job_Name'

Open in new window

Add this step to EnableJob.
UPDATE MSDB.dbo.sysjobs SET Enabled = 1 WHERE name = 'Your_Job_Name'

Open in new window

In this way you can enable/diable your actual job not to run during 10PM to 10.15PM
0
 

Author Closing Comment

by:rjackmanwyn
ID: 35041533
Very nice thank you
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now