:::: MENU ::::

T-SQL script to list all languages and their IDs in SQL Server 2005 and SQL Server 2008

  • Jan 23 / 2009
  • 0
dbDigger, T-SQL Scripts, T-SQL Tips and Tricks

T-SQL script to list all languages and their IDs in SQL Server 2005 and SQL Server 2008

A DBA may be required LanguageID to query in system catalog and resources. For example in SQL Server 2000, to get complete default list of SQL Server error number, severity level and error description you have to use following command

/*
Get default list of SQL Server error numbers
and descriptions in SQL Server 2000
*/

USE Master
SELECT * FROM SysMessages
GO

While to get same list in SQL Server 2005 or 2008, you have to modify the command as

/*
Get default list of SQL Server error numbers
and descriptions in SQL Server 2005 and SQL Server 2008
*/

USE Master
SELECT * FROM SysMessages
WHERE MsgLangId = 1033
GO

So we have to provide the language ID in some cases. To get list of languages along with ID use following script

/*
T-SQL Script to list all languages
and their IDs in SQL Server 2005 and SQL Server 2008
*/

USE Master
SELECT MsgLangId, Alias
FROM Sys.SysLanguages
GO

LanguageList
You may further choose use full parameters from Sys.Languages table.

Consult us to explore the Databases. Contact us