Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is it possible to add a new language to SQL Server 2008 and edit SQL error messages with message_id less than 50000?

share|improve this question
6  
Messing with any system table (sys.messages is a view, but anyhow) would be a "Bad Idea". Also, note that this is not how error messages are "implemented" behind the scenes - adding a new language doesn't/wouldn't work by adding entries to sys.messages. –  Christian.K Mar 12 '12 at 14:41
    
For exmple I want to add Persian Language and add sys.messages for error number 18456(Login failed) –  Ehsan Mar 12 '12 at 14:45
add comment

migrated from stackoverflow.com Mar 13 '12 at 0:24

This question came from our site for professional and enthusiast programmers.

3 Answers

I don't think it is possible or advisable to edit messages below 50000 in SQL server. You can create user defined messages for ids greater that 50000 using sp_addmessage.

Another possibility is to use RAISERROR to return dynamic messages. The message is returned as a server error message to the calling application or to an associated CATCH block of a TRY…CATCH construct.

share|improve this answer
add comment

No, system tables and DMVs cannot be edited. As I understand your needs, you need to handle the exceptions and modify the error messages in client code, for example, when you connect to database.

share|improve this answer
add comment

No. Beside the obvious issue of modifying system tables, actually sys.messages has separate issue: messages with id below 50000 do not come from a table. The built-in system error messages are ordinary application resources. To modify them you would have to modify binaries, and this would be prevented by the code signing.

share|improve this answer
add comment

Your Answer

 
discard

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