Saturday, April 6, 2013

Enumerate All SQL Jobs with Alerts

The following SQL code will enumerate all jobs on a SQL Server that have alerts associated with the job. It will also list the operator to be notified and the email address used in the notification.

use msdb

select j. name, o .name, o.email_address
from sysjobs j
join sysoperators o on j.notify_email_operator_id = o. id
order by j.name asc


No comments:

Post a Comment