/ 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
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
SELECT 'exec msdb..sp_update_job @job_name = ''' + name + ''', @enabled = 0' FROM msdb..sysjobs WHERE enabled = 1