Home > General DBA > How to enable/disable a job scheduled in SQLServer Agent?

How to enable/disable a job scheduled in SQLServer Agent?

Using msdb.dbo.sp_update_job one can disable or enable jobs, the job_id can be retrieved from msdb.dbo.sysjobs

To enable
EXEC msdb.dbo.sp_update_job @job_id, @enabled = 1

To disable
EXEC msdb.dbo.sp_update_job @job_id, @enabled = 0

Categories: General DBA Tags: , ,
  1. No comments yet.
  1. No trackbacks yet.
6 visitors online now
6 guests, 0 members
Max visitors today: 11 at 12:30 pm UTC
This month: 11 at 09-07-2010 12:30 pm UTC
This year: 62 at 07-28-2010 05:49 pm UTC
All time: 62 at 07-28-2010 05:49 pm UTC