How to get SQL Server available alerts infomation ?


Am looking SQL query to get all available server alerts information including- db_name, and all related information about alerts

more ▼

asked Apr 24, 2012 at 08:41 AM in Default

avatar image

1.4k 90 93 97

Did you mean sysalerts table in msdb database?

Apr 24, 2012 at 09:29 AM Cyborg
(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

Alerts information is stored in the msdb database. Here is a sample query to get a little information about alerts on your system:

 SELECT  SA.name AlertName,
         SC.name AlertCategory,
         SJ.name JobName,
         SO.name OperatorName,
         SO.email_address OperatorEmailAddress
 FROM    dbo.sysalerts AS SA
 LEFT JOIN dbo.sysjobs AS SJ ON SA.job_id = SJ.job_id
 LEFT JOIN dbo.sysnotifications AS SN ON SN.alert_id = SA.id
 LEFT JOIN dbo.sysoperators AS SO ON SO.id = SN.operator_id
 LEFT JOIN dbo.syscategories AS SC ON SC.category_id = SA.category_id

Be aware that the designer of the tables in msdb (not just alerts) decided to store date and time information as ints. You will need to consider that when wanting to do date comparisons or conversions.

more ▼

answered Apr 24, 2012 at 09:42 AM

avatar image

26.2k 18 38 48

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Apr 24, 2012 at 08:41 AM

Seen: 1657 times

Last Updated: Apr 24, 2012 at 10:57 AM

Copyright 2018 Redgate Software. Privacy Policy