Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 Checking if key job is enabled
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

314 Posts

Posted - 04/21/2006 :  13:37:34  Show Profile  Reply with Quote
Ever have one of those days where you are working on a database and disable jobs until you are finished. A month later you realize that you weren't doing something that you should have been? I wrote the following script after realizing that another system administrator had disabled a key job "temporarily" and then forgot to turn it back on. The script simply checks the sysjobs table for a key job name that you give it and will email you if that job gets disabled for any reason.

declare @enabled as integer
select @enabled = enabled from msdb..sysjobs where name = '[Daily] ServerName Nightly Backup/Maintenance'
if @enabled = 0
	exec master..xp_sendmail @recipients = 'email.goes@here', @subject = '**  Nigthly backup job is not enabled **', @message = 'This is to inform that for whatever reason the nigthly backup job for SERVER NAME that should be enabled has been disabled and will not be executed tonight'
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000