Solved

Sceduled SQL Jobs

Posted on 2011-03-04
2
298 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
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 shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 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