1

If I run the following query:

select datename(month, dateadd(m,-1,getdate())) 

SQL Server shows me: October.

How can I change this language to, for example, Dutch?

Not only for the current session, but for all incoming queries. Queries are sent by an external application so I do not have control over the queries.

I tried:

  • SET LANGUAGE DUTCH
  • EXEC sp_configure 'default language', 7 ;
  • Server properties - advanced - Default Language - Dutch

None of the above seems to work..

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
OverflowStack
  • 259
  • 1
  • 3
  • 17
  • 'set language' should work - but only for current session. If you are issuing queries from some program, not SSMS, then you should use this setting in same query, like 'set language dutch; select datename...'. I would do such conversions in client side however. – Arvo Nov 05 '14 at 11:36
  • They seem to work for me... `SET LANGUAGE DUTCH` before the select gives me "oktober" (verbatim). – Lasse V. Karlsen Nov 05 '14 at 11:37
  • SET LANGUAGE works only for current session. So I guess you need to first execute SET LANGUAGE Dutch query and then execute your main query. – Mukund Nov 05 '14 at 11:37
  • To set language, you need to edit syslanguages table in Master DB, Check the following URL: http://stackoverflow.com/questions/1187127/sql-server-datetime-issues-american-vs-british – Paresh J Nov 05 '14 at 11:40
  • 1
    The server deafult language is only used when you create a new login - so if the login(s) used by this application's users already exist, you need to go and change the default for each login. (And the default language will only work if the application, itself, *doesn't* issue its own misguided `SET LANGUAGE` statements) – Damien_The_Unbeliever Nov 05 '14 at 11:53

2 Answers2

1
    ALTER LOGIN [Domain\User] WITH DEFAULT_LANGUAGE = Dutch;
OverflowStack
  • 259
  • 1
  • 3
  • 17
0

You can use sp_configure and RECONFIGURE keywords respectively like below (you didn't use RECONFIGURE after the execution of sp_configure I believe):

USE <your db>;
GO
EXEC sp_configure 'default language', 7 ;
GO
RECONFIGURE ;
GO

where 7 is the code for "Dutch"

You can run the query below to see all the languages with corresponding IDs:

select langid, alias from sys.syslanguages

Ref: How to change default language for SQL Server?

Eray Balkanli
  • 7,752
  • 11
  • 48
  • 82