Posted By

pollusb on 03/20/09


Tagged

admin msdb


Versions (?)

Deactivate jobs on SQL Server


 / Published in: SQL
 

Let's say you need to deactivate jobs, do something, then reactivate jobs. You can use this to generate the code for both by changing "@enabled = 0" with 1

  1. SELECT 'exec msdb..sp_update_job @job_name = ''' + name + ''', @enabled = 0'
  2. FROM msdb..sysjobs
  3. WHERE enabled = 1

Report this snippet  

You need to login to post a comment.