SQL SERVER – Find Out Current Language of the Session

After reading my post SQL SERVER – Puzzle – Playing with DateTime with Customer Data, one of my blog readers asked me “How to find out the current language setting of the session?”

SQL SERVER - Find Out Current Language of the Session session-1

With the help of the system variable and system view, we will be able to easily find out the language of the server

As per Books On-Line, the system function @@LANGID returns the local language identifier (ID) of the lang that is currently being used. The system view SYS.SYSLANGUAGES contains information about all the languages that are supported in the current instance of SQL Server.

Solarwinds

We can make use of these to find out the language of the session

SELECT NAME,ALIAS FROM SYS.SYSLANGUAGES
WHERE LANGID= (SELECT @@LANGID)

The result is

SQL SERVER - Find Out Current Language of the Session language_result1

Let us change the language into GERMAN

SET LANGUAGE 'GERMAN'

After executing the above statement, wow execute the same SELECT statement

SELECT NAME, ALIAS FROM SYS.SYSLANGUAGES
WHERE LANGID= (SELECT @@LANGID)

The result is

SQL SERVER - Find Out Current Language of the Session language_result2

Let me know if you know any other methods.

If you have SQL Server Performance issues, you can consider to hire me to help you to improve your SQL Server Performance. Here is the link to my most popular service: Comprehensive Database Performance Health Check. If you want to learn about SQL Server Performance tuning, you can hire me to deliver a workshop for you SQL Server Performance Tuning Practical Workshop.

Reference: Pinal Dave (https://blog.sqlauthority.com)

Solarwinds
, , ,
Previous Post
SQL SERVER – Identify Datatype Using SQL_VARIANT_PROPERTY Function
Next Post
SQL SERVER – Enabling Older Legacy Cardinality Estimation

Related Posts

1 Comment. Leave new

  • Hi Pinal,

    I am using SQL Server 2016 and can use @@LANGUAGE instead of @@LANGID and system view SYS.SYSLANGUAGES.

    Thanks,
    Srini

    Reply

Leave a Reply

Menu