Solved

Sceduled SQL Jobs

Posted on 2011-03-04
2
302 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 41

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

RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

Question has a verified solution.

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

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

636 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