Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a Sql server 2012 agent job which currently runs every minute, every day, etc.

I'd like to modify it so that it will run every minute, every day except on Saturdays between 7:00 pm and 11:30 pm. Is this possible with the job scheduler?

I tried using a daily frequency and I can change the time on a per day basis that way, but not for a specific day.

Current schedule:

enter image description here

share|improve this question
6  
I've never tried this but I think I've seen that you can have multiple schedules on a single job. If so, create one for every minute on every day except Saturdays, and possibly two more for Saturdays, 12am till 7pm and 11:30pm till 12:59pm. –  Andriy M Jul 16 '13 at 18:19
2  
Or one schedule that runs every day from 11:30pm to 06:59pm and another that runs every day except Saturday from 07:00pm to 11:29pm –  SQLFox Jul 16 '13 at 18:26
    
@AndriyM I've used your suggestion. If you post an answer I'll accept that. –  Mansfield Jul 16 '13 at 18:35
    
Would it be possible to run a .NET application whose sole job is scheduling rather than having a Sql Server job? #Quartz –  jcolebrand Jul 16 '13 at 18:40
    
@jcolebrand Yuck. Sounds like far more trouble than it's worth. –  Mansfield Jul 16 '13 at 18:41

1 Answer 1

up vote 4 down vote accepted

I don't think you can work with that single job to get that exact schedule. You might want to consider having another job that disables/enables the job for the period of time that you don't want it to run. Another solution would be to add another conditional logic to your existing job and do a check on the current day of the week and what time it is, and decide whether or not to execute your job's logic.

A few alternatives here, but I think you'll have to get creative with your relatively complex schedule.

share|improve this answer
1  
Interesting. Any thoughts on @AndriyM's comment? (would that be preferable to your idea for instance) –  Mansfield Jul 16 '13 at 18:26
    
I second conditionals within the code –  jcolebrand Jul 16 '13 at 18:40
1  
Yep, that should definitely be a possibility. Whatever solution you choose, the point is it'll have more than one dimension that we typically work with. –  Thomas Stringer Jul 16 '13 at 18:41
    
@jcolebrand Unfortunately this job calls an SSIS package, and the problem I'm trying to avoid is based on the SSIS package running at all, not what it's doing (the SSIS maintenance job is running into locks, more info here if you're interested: ssistalk.com/2012/07/16/…) –  Mansfield Jul 16 '13 at 18:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.