Home > T-SQL > Languages in SQL Server

Languages in SQL Server


The session language determines the datetime formats and system messages of the SQL Server environment. There are various ways to get the language setting on the current environment. We can also set the new language for the session.

In this blog post I will show you various SQL commands that are used to get and set the language settings.

1. @@LangID returns the local language identifier (ID) of the language that is currently being used in SQL Server.

Select @@LangID

pic1

2. @@Language returns the name of the language currently being used in SQL Server.

Select @@Language

pic23. sys.syslanguages is system view. It lists the SQL Server languages name and its settings.

select *  from sys.syslanguages

pic34. Set Language is used to specifies the language environment for the session.

set Language  N’magyar’
select 1/0

Set Language English
Select 1/0

pic45. sp_helplanguage returns information about specific or all language.

sp_helplanguage ‘French’

pic5If you execute this stored procedure without arguments it will list information about all languages.

These commands are very helpful to run an application with different language settings.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: