0

How can I configure an email notification when SQL Server Agent job fails because the owner does not have server access?

I've created a new alert but apparently, I've not selected the appropriate selection for "Alerts will be raised based on" option.

We had an administrator disable a few existing users. That admin not realize that there are jobs where the owner is the disabled user. I've inventoried and revised the owner for those jobs, but would like to set up a notification should this occur in the future.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
ghoh
  • 65
  • 1
  • 12
  • Probably better to follow best practices than create workarounds. Run the jobs with a non-user service account that does not get disabled. https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-windows-service-accounts-and-permissions – Jacob H Jun 05 '17 at 14:53
  • Thank you. I did reconfigure the jobs to use a service account user. It is important to know that one job in particular did run regardless of any type of error. I'm looking into adding a final job step that sends an email if it completes. – ghoh Jun 05 '17 at 15:37
  • 1
    What about type 14 (Insufficient Permission)? Or 16 for General User error? You should be able to match the error type from the history window on the SQL Agent Job to the Alert you want to raise in the job itself. – Jacob H Jun 05 '17 at 15:50

0 Answers0