How to get an alert working

  • Hi,

    In an attempt of testing the Alerts in SQL Server 2008, I've done the following:

    1. created an operator an my email

    2. create an alert that should send email if error of severity=11 is issued (which includes accessing not found object).

    [font="Courier New"]EXEC msdb.dbo.sp_add_alert @name=N'Monitor when accessed object not found',

    @message_id=0,

    @severity=11,

    @enabled=1,

    @delay_between_responses=0,

    @include_event_description_in=1,

    @notification_message=N'monitor when object isn''t found',

    @category_name=N'[Uncategorized]',

    @job_id=N'00000000-0000-0000-0000-000000000000'[/font]

    3. to test the alert, I issued the following command:

    [font="Courier New"]drop table x;[/font]

    which returns the following error:

    [font="Courier New"]Msg 3701, Level 11, State 5, Line 3

    Cannot drop the table 'x', because it does not exist or you do not have permission.[/font]

    Yet, no email sent.

    The Agent service is running.

    Any clarification is appreciated.

  • Have you configured database mail and tested if it is working fine?

    M&M

  • Database mail is configured. I sent a test email from it and it worked just fine. Still the alert is not working.

  • Did you check the db mail log to see the messages?

    M&M

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

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