Simply test on the current time in the job, like
IF NOT CONVERT(time, GETDATE()) BETWEEN '19:00:00' AND '23:30:'
BEGIN
-- Do the job
SELECT 1
END
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a Sql server agent job which currently runs every 30 minutes, every day, etc.
I'd like to modify it so that it will run every 30 minutes, every day except between 7:00 pm and 11:30 pm. Is this possible with the job scheduler?
Simply test on the current time in the job, like
IF NOT CONVERT(time, GETDATE()) BETWEEN '19:00:00' AND '23:30:'
BEGIN
-- Do the job
SELECT 1
END
Create 2 schedules:
Hi @MuralidharTangudu-6301,
As Viorel mentioned, please try this.I test it in my environment, the job works well.
Best regards,
Cathy
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.