1

My SQL Server 2008 R2 keeps recording these error in the SQL Server log:

Error 600122, severity 11, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.

Some are:

Error 400006, severity 16, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.

I also got similar errors in server event log as follow:

Error 600122, severity 11, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage.

Are they with regard to compatibility level of Databases as https://www.experts-exchange.com/questions/28523045/Error-55555-severity-16-state-1-was-raised-but-no-message-with-that-error-number-was-found-in-sys-messages-If-error-is-larger-than-50000-make-sure-the-user-defined-message-is-added-using-sp-addm.html said?

Is there anybody resolved it? Because it's in my Prod environment so I want to get more info.

Thanks a lot!

0

2 Answers 2

1

They are generated in your code, try this to locate them

SELECT  *
FROM    sys.sql_modules SM
WHERE   [definition] LIKE '%600122%' or [definition] LIKE '%400006%'

Or this will also bring all custom error

SELECT  *
FROM    sys.sql_modules SM
WHERE   UPPER([definition]) LIKE '%RAISERROR%' or UPPER([definition]) LIKE '%THROW%'

https://docs.microsoft.com/en-us/sql/t-sql/language-elements/raiserror-transact-sql

Error numbers for user-defined error messages should be greater than 50000. When msg_id is not specified, RAISERROR raises an error message with an error number of 50000.

2
  • I ran the scripts in my instance. But nothing exists. Could you please tell me more details? Thanks. Sep 8, 2017 at 18:53
  • As the link says, custom errors should be greater than 50000. If you have enough rights you should find them. Run this scripts in all databases
    – Horaciux
    Sep 8, 2017 at 19:34
0

One explanation is that there are RAISERROR statements used for say logging.

DECLARE @i int = 600122;
RAISERROR (@i,0,1) -- Logging

Here @i is used for specifying the message by message id @i and should be RAISERROR ('%d',0,1,@i)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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