SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SQL Server Agent Alerts and C# or .NET


SQL Server Agent Alerts and C# or .NET

Author
Message
alex.sqldba
alex.sqldba
SSCertifiable
SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)

Group: General Forum Members
Points: 5537 Visits: 1189
Morning All,

SQL Server Agent can generate alerts. Does anyone know if they can be consumed by a .NET application rather than relying on an Operator to forward them?

IF so, how so?

Cheers
Alex
Sue_H
Sue_H
SSC-Dedicated
SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)SSC-Dedicated (35K reputation)

Group: General Forum Members
Points: 35969 Visits: 10278
Not sure exactly what you want to do, probably me and not enough coffee yet, but the response to alerts is either an operator or a job so it doesn't necessarily have to go through an operator. And a job could do a lot of different things. And the alert doesn't necessarily need to have a response. The firing of alerts, the last date and time, number of occurrences is in the sysalerts table in msdb. So it seems different things could be done outside of using an operator.

Sue




alex.sqldba
alex.sqldba
SSCertifiable
SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)SSCertifiable (5.5K reputation)

Group: General Forum Members
Points: 5537 Visits: 1189
Sue_H - Wednesday, April 12, 2017 8:44 AM
Not sure exactly what you want to do, probably me and not enough coffee yet, but the response to alerts is either an operator or a job so it doesn't necessarily have to go through an operator. And a job could do a lot of different things. And the alert doesn't necessarily need to have a response. The firing of alerts, the last date and time, number of occurrences is in the sysalerts table in msdb. So it seems different things could be done outside of using an operator.

Sue

The firing of alerts, the last date and time, number of occurrences is in the sysalerts table in msdb.


This is what I was unable to articulate, exactIy.
For a moment I wondered if there was a Windows Event I could capture in .NET but really, all I need to keep an eye on the sysalerts you mentioned.

Thanks Sue! Perfect Answer!

Cheers
Alex

ALZDBA
ALZDBA
SSC Guru
SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)SSC Guru (75K reputation)

Group: General Forum Members
Points: 75563 Visits: 9250
just a little caution:
If you have an alert activating a job, and you disable the job without disabling the alert, your SQLAGENT.OUT file will explode because it still tries to launch the job until that succeeds ( about 6 times a second, all logged in that sqlagent.out file )

For sqlagent to act on its first alert, you may need to restart it.

Johan


Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere w00t

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


press F1 for solution, press shift+F1 for urgent solution :-D


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me Alien but most of the time this is me Hehe
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search