SQL 2005 ALERTS Not Working for non-logged events

  • SQL 2005 Enterprise X64 SP4

    ALERTS: SQL SERVER EVENT ALERT ---->Severity

    Has anyone noticed that the Alerts only seem to trigger when the "Event" is logged to the Errorlog?

    Anything that does not end up in the log does not seem to produce an alert response or update the alert history.

    I can recreate this easily:

    RAISERROR('Error test, 16, 1) WITH LOG; -- This triggers alert successfully

    RAISERROR('Error test, 16, 1); -- This will not

    My problem is I would like non-user defined errors to trigger alerts.

    For example: Msg 8134, Level 16, State 1, Line 1

    Is this a known bug? Are there configuration settings to change what errors are recorded in the log?

    Can I send all Severity 16 to the log? (without raiserror)

    Thanks for your help.

    Mark G.

  • These are the English messages that get logged automatically.

    SELECT *

    FROM sys.messages

    WHERE language_id = 1033

    AND (

    is_event_logged = 1

    OR severity >= 19

    )

    ORDER BY message_id;

    If you want to start logging error 8134, or any message that is not logged by default, you can use this:

    DECLARE @message_id INT = 8134;

    EXEC sys.sp_altermessage

    @message_id = @message_id,

    @parameter = 'WITH_LOG',

    @parameter_value = 'TRUE';

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • OPC, exactly what I was looking for.

    Thank you very much!

    Mark G.

  • You're welcome. Thanks for the feedback.

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply