info@techdevops.com
TechDevOps.com
Explore Tools
Experts in Microsoft SQL Server Operations, Performance, Replication, Cloud & Migrations



Enable or Disable All SQL Jobs
by BF (Senior MSSQL Operations - Enterprise, Cloud, Strategy)
2017-11-18









T-SQL:


Disable All SQL Jobs:
SELECT 'Exec MSDB..sp_update_job @job_name = '''+NAME+''', @enabled = 0' FROM MSDB..sysjobs order by name asc


Enable All SQL Jobs:
SELECT 'Exec MSDB..sp_update_job @job_name = '''+NAME+''', @enabled = 1' FROM MSDB..sysjobs order by name asc


Check All SQL Jobs Enabled Status:
Select [enabled], name from MSDB.dbo.sysjobs order by name asc