Custom Search
Logiclabz

T-SQL to Disable/Enable Job in SQL Server 2005

The following query shows the list of jobs running on the sql server.

select * from msdb..sysjobs

From the msdb..sysjobs, the required job_id for enable or disable to be taken.

T-SQL to dis-enable specific job in sql server

 EXEC msdb..sp_update_job @job_id = '770F175B-C8A0-4157-BACD-0AF129DF570C', @enabled = 0  

T-SQL to enable specific job in sql server

 EXEC msdb..sp_update_job @job_id = '770F175B-C8A0-4157-BACD-0AF129DF570C', @enabled = 1  

 



Leave a reply


Do you like this post?