• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 368
  • Last Modified:

how to raise user defined alert

It is sql server 2000, I set a user defined alert (error number 99999) from Management->Alert in Enterprise manager, then I try to triger this error by sql statement, something like raiserror 99999, 'test error'.

But the alert is not triggered, why?
0
DataField
Asked:
DataField
1 Solution
 
stevetheskiCommented:
if exists(select 1 from person where username = @username and personid != @PersonID)
                  BEGIN
                     RAISERROR (50007, 15, 1)
                     RETURN
                  END
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now