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.

link|improve this question

feedback

2 Answers

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.

link|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
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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