Generate a script to disable all active jobs on server.

USE msdb
GO
SELECT 
	'EXEC msdb.dbo.sp_update_job @job_name = N' + CHAR(39) + name + CHAR(39) + ' ,  @enabled = 0 ' + CHAR(10) + 'GO' 
FROM
	sysjobs (NOLOCK) 
WHERE 
	enabled = 1

Returns all jobs that are not idle or suspended.

EXEC msdb.dbo.sp_help_job @execution_status=0
GO

Last modified: September 17, 2019

Author

Comments

Write a Reply or Comment