MEA Center of Expertise

We are a 120+ technology enthusiasts helping Microsoft customers around Middle-East & Africa region. We bridge Microsoft tools & technologies to their businesses.

Update SQL Agent Jobs Schedules with T-SQL

Update SQL Agent Jobs Schedules with T-SQL

  • Comments 1
  • Likes

after building your SSIS project and putting it into action you just start doing some JOB Schedules through the SQL Agent, but when you have a lot of schedules updating them starts to get annoying. and you can start getting some queries to list the Jobs, tasks and schedules in our discussion now we’ll focus on table “sysschedules” as this is the one that holds the info for schedules. and we’ll focus on exactly two fields.

freq_type How frequently a job runs for this schedule.

1= One time only

4= Daily

8= Weekly

16= Monthly

32 = Monthly, relative to freq_interval

64= Runs when the SQL Server Agent service starts

128= Runs when the computer is idle

and

active_start_time: Time on any day between active_start_date and active_end_date that job begins executing. Time is formatted HHMMSS, using a 24-hour clock.

now let’s say that all your schedules are daily and they are in frequent starting 1am. then you need to add a new schedule before them but you don’t need to re-schedule all of the jobs using the SQL Agent, simply update the table adding 3000 (30 minutes) to all schedules so will be alerted.

you can as well change the frequency, active status through this table. the detailed table documentation can be found here

Comments
Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment