November 24, 2009 at 1:30 pm
Ok, it has been a while since I fire an alert based upon an error message but I have the following
sp_addmessage @msgnum = 65019,
@severity = 9,
@msgtext = 'Missing inmate in FW profile ',
@with_log = 'true'
raiserror (65019,16,9)
I setup an alert to work with error message 65019, but raise error will not fire the alert
November 25, 2009 at 6:25 am
Tim,
If I remember correctly you must use the WITH LOG option in you RAISERROR command in order for the alert to be triggered.
[font="Verdana"]Markus Bohse[/font]
November 25, 2009 at 6:49 am
Read this for more information on RAISERROR:
http://msdn.microsoft.com/en-us/library/ms178592(SQL.90).aspx
http://msdn.microsoft.com/en-us/library/ms178649(SQL.90).aspx
November 25, 2009 at 7:25 am
- You'll have to define the alert "with log", because if a user raises the error using "with log" (s)he must be member of sysadmin :ermm:
- you may have to stop and restart SQLAgent to activate your first alert responce.
You can find the proc I use at http://www.sqlservercentral.com/scripts/Miscellaneous/31032/
Johan
Learn to play, play to learn !
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[/url]
- How to prevent a sore throat after hours of presenting ppt
press F1 for solution, press shift+F1 for urgent solution 😀
Need a bit of Powershell? How about this
Who am I ? Sometimes this is me but most of the time this is me
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply