Disable SQL Server Agent Job – SQL Server

Recently we had an issue with our tape backup system, we needed to quickly disable backup jobs to tape and enable backup jobs to drive. There were multiple jobs and using SSMS gui would have taken too much effort and time. To disable or enable multiple jobs update the sysjobs table in msdb.

Get list of jobs.

SELECT * FROM msdb.dbo.sysjobs

Update sysjobs table to disable job.

UPDATE msdb.dbo.sysjobs
SET enabled = 0
WHERE 1=1
AND job_id = '87D56BD2-EC90-4A6C-A00C-30A8F81133F5'

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>