Joe Webb

Musing and observations about SQL Server, other technogies, and sometimes just life in general
posts - 85, comments - 291, trackbacks - 0

My Links

SQLTeam.com Links

News

This blog has moved!

Click here for the new location.

Follow me on Twitter
Add to Technorati Favorites

Search this Blog
 




Archives

Post Categories

About me

The 33 languages of SQL Server

I was recently perusing the the MSDN SQL Server forums and noticed a question about localization of Microsoft SQL Server messages. I replied to the post with a mention of the sys.messages table - the table where SQL Server messages are stored. I blogged about this system table a few months ago.

Afterward I started playing around some more with the sys.messages table. I started with the following basic query.

 languages1-2008-05-30

The first thing to notice is that each message_id has one or more languages associated with it. Message_id 21, for example, has a row for language_id 1033, 1031, 1036, etc. It's fairly obvious to me that language_id 1033 is my native tongue, English. And I can make some educated guesses on some of the other languages. But where are they defined?

Well, the syslanguages system table contains a list of each language that SQL Server recognizes. For example, run the following query in a Management Studio Query Window.

languages2-2008-05-30

1033 is indeed US English. And 1031 is German, 1036 is French, and so on. There are 33 languages in all - US English and British English are considered two different languages in here, though they share the same messages.

But what's interesting is that not all languages in the syslanguages system table are represented in the sys.messages table. For example, consider the following query.

SELECT 
m.language_id
,l.alias
,COUNT(*)
FROM
sys.messages AS m JOIN
 syslanguages AS l
ON l.msglangid = m.language_id
GROUP BY
l.alias
,m.language_id

 

The results indicate that only 11 languages (10 if you consider US English and British English to be one and the same) are represented in the sys.messages table. 

languages3-2008-05-30

So, that must mean that the other languages don't have a need for messages. :) Right, if that's that case, remove US English from the list!

Actually if a language is not present in the sys.messages table, a default language will be used instead. For more information, check out the sp_addmessage procedure and the sys.messasges system table in Books Online.

Cheers!

Joe

kick it on DotNetKicks.com

Print | posted on Friday, May 30, 2008 3:54 PM

Feedback

# re: The 33 languages of SQL Server

Joe: what tool do you use to get those screen grabs with the jagged edges?
7/12/2008 12:17 AM | Bennie Ribaldi

# re: The 33 languages of SQL Server

I use SnagIt for the screenshots. It's a great product.
7/12/2008 9:21 AM | Joe Webb

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 6 and 8 and type the answer here:

Powered by: