Return to Snippet

Revision: 12608
at March 20, 2009 18:05 by pollusb


Initial Code
select 'exec msdb..sp_update_job @job_name = ''' + name + ''', @enabled = 0' 
from msdb..sysjobs
where enabled = 1

Initial URL


Initial Description
Let's say you need to deactivate jobs, do something, then reactivate jobs. You can use this to generate the code for both by changing "@enabled = 0" with 1

Initial Title
Deactivate jobs on SQL Server

Initial Tags


Initial Language
SQL