July 31, 2008 at 8:08 am
I currently have a job scheduled to run at 5:00 AM every morning. I need to have the job run at 6:30 AM on the first day of the month and at 5:00 AM every other day of the month. While setting up each of these schedules independently is easy to do. The problem I am having is how I keep the 5:00 AM schedule from executing the job on the first day of the month.
Any suggestions?
July 31, 2008 at 8:20 am
I think I have a workable solution that is relatively simple. Create your daily job and do not schedule it and your first of the month job with a schedule. Then create a new job scheduled to run daily at 5 am. In this new job you check the date and if it is the first day of the month exit and if not you fire off the Daily Job you already have created using sp_start_job. So your code in the new Job Manager job is:
[font="Courier New"]IF (SELECT DATEPART(DAY, GETDATE())) <> 1 THEN
BEGIN
EXEC sp_start_job @job_name = 'Daily Processing Job'
END[/font]
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
July 31, 2008 at 8:48 am
Thanks Jack for your reply. The soution you outlined will work. So simple yet so sweet. Thanks again.
July 31, 2008 at 9:07 am
Simple minds only see the simple solutions
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply