SQL Stuff

Get A List Of All Schedule ID’s For Agent Jobs

Here’s some quick SQL Logic to show you all the schedule ID’s across all your Jobs. This will help if you have multiple agent jobs across the enterprise that have the same purpose, and you need to modify the schedule across them all. Getting the Schedule ID will allow you to do a mass update of the schedules.

use master;
set nocount on

select
sj.name
,	sjs.step_id
,	sjs.step_name
,	sjsched.schedule_id
from
msdb..sysjobs sj join msdb..sysjobsteps sjs on sj.job_id = sjs.job_id join msdb..sysjobschedules sjsched on sj.job_id = sjsched.job_id order by
sj.name
,	sjs.step_id asc

Advertisements

Categories: SQL Stuff

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s