I have a number of SQLServer agent scheduled jobs, one of them performs a full database backup. I want to disable some other jobs when backup begins and re-enable them once backup is done. What is the right way to do so? I was thinking about adding one of the following tsql commands to the first step of the backup task (and respective enable commands to the last step), but I cannot find which one is better (or maybe there is another way).
UPDATE MSDB.dbo.sysjobs
SET Enabled = 0
WHERE [Name] IN (....)
Or a number of EXEC dbo.sp_update_job
?
Thanks.
UPDATE sysojobs
directly or by usingsp_update_job
? – Hannus