Files
sql-snippets/disable_all_jobs-67e4d51f-49ee-4e47-9cac-0bd7496371f3.json
2023-07-10 12:00:17 +02:00

6 lines
404 B
JSON

{
"id": "67e4d51f-49ee-4e47-9cac-0bd7496371f3",
"prefix": "disable_all_jobs",
"description": "generate sql to disable all jobs on the local server",
"body": "SELECT 'Exec MSDB.dbo.sp_update_job @job_name = N''' + SJ.name + ''', @Enabled = 0'\r\n FROM msdb..sysjobs SJ\r\n INNER JOIN msdb..syscategories SC\r\n ON SJ.category_id = SC.category_id\r\n WHERE [SJ].[enabled] = 1;"
}