Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Some of the developers are using the following syntax in RaiseError:

RAISERROR('My business error message', 16, 0)

With the purpose of reusing the catch part of the try..catch block for business error too.

But I spotted several event log entries like this:

Msg # 50006, <blabla> please register the error message with sp_addmessage

There's some way to disable the creation of such events? I searched google, msdn and docs but didn't find a clue.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

It means some other developers are using RAISERROR(50006, 16,1)... When the msgid syntax is used (or when the @local_variable in thesyntax is an int) the expectation is that the message was added to the local messages table. This is the normal approach for localized errors, to raiserror a msgid and add messages localized for various languages.

Whatever application/developer uses the msgid syntax, he/she is also responsible to add the message to the messages table during deployment, for the locale of the server.

share|improve this answer
    
HMmm... Interesting. I'll do some investigation..... And return to the SF to clarify the question. –  Fabricio Araujo Feb 27 '10 at 14:46

RAISEERROR('This is just information', 10, 1)

This will tell SQL Server to raise a non fatal error.

Ref: http://www.sqlteam.com/article/handling-errors-in-stored-procedures

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.