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).
“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).
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.
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.
Using SQL Server Management Studio
To configure the default language option
English
.Using Transact-SQL
To configure the default language option
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 |
@John Woo's accepted answer has some caveats which you should be aware of:
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With