Solved

Sceduled SQL Jobs

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

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

911 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

19 Experts available now in Live!

Get 1:1 Help Now