x
login about faq Site discussion (meta-askssc)

How to get SQL Server available alerts infomation ?

Hi,

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

more ▼

asked Apr 24 '12 at 08:41 AM in Default

Amardeep gravatar image

Amardeep
1.3k 74 83 87

Did you mean sysalerts table in msdb database?

Apr 24 '12 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 '12 at 09:42 AM

WilliamD gravatar image

WilliamD
25.4k 16 18 41

(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

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1611
x10

asked: Apr 24 '12 at 08:41 AM

Seen: 597 times

Last Updated: Apr 24 '12 at 10:57 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.