To List the disabled Jobs and their relative schedules , you can run the following query:
USE msdb GO SELECT ss.schedule_id , J.name, ss.name, J.enabled [Job Enabled ?], ss.enabled [Schedule ENABLED ?] FROM sysjobs J JOIN sysjobschedules s ON J.job_id = s.job_id JOIN sysschedules ss ON s.schedule_id = ss.schedule_id WHERE J.enabled = 0
The schedule_id can be used directly with sp_update_schedule, as from SQL 2008 schedules can be managed independantly of jobs.
No comments:
Post a Comment