﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 7,2000 / SQL Server Agent  / Setting up alerts for specific error messages / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sat, 25 May 2013 17:34:45 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Setting up alerts for specific error messages</title><link>http://www.sqlservercentral.com/Forums/Topic713232-110-1.aspx</link><description>Have you checked in the repsonse tab that it isn't running the job as a response to the alert being raised ?I had this problem where through Management Studio I could not remove the tick from the box on "run job" in the response tab, so was getting spammed by alert emails as I ran the job, the alert was raised, which then ran the job agaiin, which alerted etc etc.Whatever I did, restarting the agent etc I could not get my removal of the tick box to stick.So finally I scripted the alert to a new window, deleted the original, and modiied the script to remove all job refs before running it to recreate the alert. Bingo ! The alert was created with the job part geyed out and box not ticked. Am now very happy that it will do what I want.</description><pubDate>Thu, 02 Jul 2009 10:04:30 GMT</pubDate><dc:creator>Bassman-970529</dc:creator></item><item><title>RE: Setting up alerts for specific error messages</title><link>http://www.sqlservercentral.com/Forums/Topic713232-110-1.aspx</link><description>Yes,I managed to fix this , but got into another problem.1. I added a message in sys.messages by executing a stored procedure EXEC sp_addmessage @msgnum = 50603,                   @severity = 16,                   @msgtext = 'Invalid number'2. Then used this messageid to raise error in the stored procedure .like RAISE ERROR(50603,16,1) WITH lOG - i initially had only RAISE ERROR (50603,16,1) it didnt work. I changed that to RAISEERROR(50603, 16, 1) WITH LOG and it worked. All severity levels less than 19 should have WITH LOG or use xp_logevent.After these two changes the alerts worked. However i was getting continously alerts for long time more than 20 alerts until I volunterly changed the stored procedure back to RAISE ERROR(50603,16,1) which will not alert.I am wondering why I am getting continous alerts though I was not executing the job. I just executed the store procedure from query analyser to raise the error..Any help on this??</description><pubDate>Fri, 08 May 2009 13:55:53 GMT</pubDate><dc:creator>Ranch</dc:creator></item><item><title>Setting up alerts for specific error messages</title><link>http://www.sqlservercentral.com/Forums/Topic713232-110-1.aspx</link><description>Hi,I am creating a job step where it executes a stored procedure.Inside the stored procedure , based on a condition I perform RaiseError('Not Valid', 16,1)So when ever this error occurs i need to notify via email to me.So for this scenario, I have set alert in Job.I have choosen the following ,I created an alert with a particular name, enabled it, Type as SQL Server Event Alert,then my Database Name,I choose Alerts will be raised based on Severity - 016 then checked the box 'Raise alert when message contains' and then Messagetext I wrote 'Not Valid'.And then also in the response tab I have notify operators I choose my Name. And then tab Options I choose - Include Alert error text in Email.When executed that particular job step, it executed that stored procedure and raised that error.However i didnt get any alerts at all...I went and i checked History tab in alerts afetr this and there is no indication that such alert occured.What I am i missing? Any help??PS : There is no problem in Database Mail and other configurations for email because I get notification for the others job..</description><pubDate>Fri, 08 May 2009 11:57:33 GMT</pubDate><dc:creator>Ranch</dc:creator></item></channel></rss>