Users: 30k; Pages Per Session: 2.5p; Avg. Session Duration: 1:35mi
TechDevOps.com
Explore Tools
{Featuring Microsoft Technologies + Enterprise Data + Cloud Computing}



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