How to resolve Error 600122, severity 11, state 1 was raised 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!
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.