Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change default language for SQL Server?

Now when I query

SELECT @@language 

it gets 'us_english'. But I need russian.

I can't use SET LANGUAGE russian for every query.

I need to set it by default (for all new sessions).

like image 749
John Wales Avatar asked Mar 29 '13 15:03

John Wales


People also ask

What language is SQL Server?

“SQL is designed based on relational algebra and tuple relational calculus, SQL consists of many types of statements, which may be informally classed as sublanguages, commonly: a data query language (DQL),[a] a data definition language (DDL),[b] a data control language (DCL), and a data manipulation language (DML).

How do I know SQL language?

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.

How do I change SQL Server settings?

To view or change server properties In the details pane, right-click SQL Server (<instancename>), and then select Properties. In the SQL Server (<instancename>) Properties dialog box, change the server properties on the Service tab or the Advanced tab, and then select OK.


2 Answers

Using SQL Server Management Studio

To configure the default language option

  1. In Object Explorer, right-click a server and select Properties.
  2. Click the Misc server settings node.
  3. In the Default language for users box, choose the language in which Microsoft SQL Server should display system messages. The default language is English.

Using Transact-SQL

To configure the default language option

  1. Connect to the Database Engine.
  2. From the Standard bar, click New Query.
  3. Copy and paste the following example into the query window and click Execute.

This example shows how to use sp_configure to configure the default language option to French

USE AdventureWorks2012 ; GO EXEC sp_configure 'default language', 2 ; GO RECONFIGURE ; GO 
  • Configure the default language Server Configuration Option

The 33 languages of SQL Server

| LANGID |        ALIAS        | |--------|---------------------| |    0   | English             | |    1   | German              | |    2   | French              | |    3   | Japanese            | |    4   | Danish              | |    5   | Spanish             | |    6   | Italian             | |    7   | Dutch               | |    8   | Norwegian           | |    9   | Portuguese          | |   10   | Finnish             | |   11   | Swedish             | |   12   | Czech               | |   13   | Hungarian           | |   14   | Polish              | |   15   | Romanian            | |   16   | Croatian            | |   17   | Slovak              | |   18   | Slovenian           | |   19   | Greek               | |   20   | Bulgarian           | |   21   | Russian             | |   22   | Turkish             | |   23   | British English     | |   24   | Estonian            | |   25   | Latvian             | |   26   | Lithuanian          | |   27   | Brazilian           | |   28   | Traditional Chinese | |   29   | Korean              | |   30   | Simplified Chinese  | |   31   | Arabic              | |   32   | Thai                | |   33   | Bokmål              | 
like image 152
John Woo Avatar answered Sep 25 '22 08:09

John Woo


@John Woo's accepted answer has some caveats which you should be aware of:

  1. Default language setting of a session is controlled from default language setting of the user login instead which you have used to create the session. SQL Server instance level setting doesn't affect the default language of the session.
  2. Changing default language setting at SQL Server instance level doesn't affects the default language setting of the existing SQL Server logins. It is meant to be inherited only by the new user logins that you create after changing the instance level setting.

So, there is an intermediate level between your SQL Server instance and the session which you can use to control the default language setting for session - login level.

SQL Server Instance level setting -> User login level setting -> Query Session level setting

This can help you in case you want to set default language of all new sessions belonging to some specific user only.

Simply change the default language setting of the target user login as per this link and you are all set. You can also do it from SQL Server Management Studio (SSMS) UI. Below you can see the default language setting in properties window of sa user in SQL Server:

enter image description here

Note: Also, it is important to know that changing the setting doesn't affect the default language of already active sessions from that user login. It will affect only the new sessions created after changing the setting.

like image 45
RBT Avatar answered Sep 26 '22 08:09

RBT