28

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).

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
John Wales
  • 1,266
  • 2
  • 14
  • 19
  • 1
    If you want to set it globally for ever, look at [this post][1] [1]: http://stackoverflow.com/questions/11220023/how-to-change-the-language-and-date-format-in-sql-server – Brian Mar 29 '13 at 15:16

4 Answers4

36

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

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              |
KyleMit
  • 35,223
  • 60
  • 418
  • 600
John Woo
  • 249,283
  • 65
  • 481
  • 481
  • 2
    I got the opposite problem. A have @@LANGUAGE set to russian, and I want to change it to english. I have executed sp_configure 'default language', 0; And reconfigured. My default language is now set to English, BUT when I query SELECT @@LANGUAGE in a new query window, it still gets me russian. Is there something I forgot? – Arsen Magomedov Aug 14 '14 at 08:11
  • 5
    Oh, just figured out, that i must change it for SQL logins – Arsen Magomedov Aug 14 '14 at 08:46
  • How-to you get `33 languages list (full)` in **SQL Server** ? – Kiquenet Feb 23 '17 at 11:04
  • Does changing the language changes the default date format `yyyy-MM-dd` used by SQL Server? – RBT Jul 28 '17 at 04:59
  • @Kiquenet : try sp_helplanguage – Dan Stef Feb 12 '18 at 06:39
  • It;s not changing in sql server 2017 express. I tried multiple times even restarted machine multiple times. Not sure what's wrong. – Jitendra Pancholi Aug 14 '19 at 08:55
  • Just a note on the script above: it does not set the language for the specified database; it changes _**the default for the instance itself**_, so please be careful. As pointed out by @ArsenMagomedov, the language for the database is actually defined on a user basis. – Paul Feb 26 '20 at 16:44
29

@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.

RBT
  • 21,293
  • 19
  • 144
  • 210
2

Please try below:

DECLARE @Today DATETIME;  
SET @Today = '12/5/2007';  

SET LANGUAGE Italian;  
SELECT DATENAME(month, @Today) AS 'Month Name';  

SET LANGUAGE us_english;  
SELECT DATENAME(month, @Today) AS 'Month Name' ;  
GO  

Reference:

https://docs.microsoft.com/en-us/sql/t-sql/statements/set-language-transact-sql

Eray Balkanli
  • 7,306
  • 10
  • 44
  • 74
Oc Romo
  • 39
  • 2
  • Welcome to StackOverflow. Instead of just posting a code block, you should provide an explanation of what it does. – AfroThundr Feb 13 '18 at 21:01
-1

If you want to change MSSQL server language, you can use the following QUERY:

EXEC sp_configure 'default language', 'British English';
Eray Balkanli
  • 7,306
  • 10
  • 44
  • 74
  • This answer needs more of an explanation; the OP asked how to change the language on a database level, not the default for the instance, which is what you've specified. – Paul Feb 26 '20 at 16:50
  • Although it doesn't answer OP's question, this extra bit of info was really useful. set language 'British English' works for TSQL. I'd been searching and tried UK, GB, "international", all to no avail. This is what I needed. So whilst I can't give an upvote - I've said thanks with the applause button (I know - I hate myself). – Rab Jul 02 '20 at 17:18