Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sceduled SQL Jobs

Posted on 2011-03-04
2
Medium Priority
?
308 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 41

Accepted Solution

by:
Sharath earned 2000 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

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

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…
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

971 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