Question

Is it possible to enable or disable the sql server agent using t-sql?

Était-ce utile?

La solution

exec msdb..sp_update_job @job_name = 'Job Name', @enabled = 0 --Disable
exec msdb..sp_update_job @job_name = 'Job Name', @enabled = 1 --Enable

Autres conseils

You can use this to set it ON or OFF

   EXEC xp_servicecontrol N'stop',N'SQLServerAGENT'
   EXEC xp_servicecontrol N'start',N'SQLServerAGENT'
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top