How display names of part date in your language?

Sometimes You display name of part of date example: name of day, name of day of week, month.

I show You how change language in SQL Server to display data in Your language. The T-SQL has procedure sys.syslanguages which display all data for all received languages.

SELECT dateformat, name, alias FROM sys.syslanguages ;

ee00
Through @@LANGUAGE variable You may check current language.

SELECT @@LANGUAGE as language ;

It returns name of language.

ee7
In the following examples is select name of weekday and number of weekday depand on current language in SQL Server – counting is depand on country(sometimes the Moday is first day, sametimes Sunday is first day). The first example select data for default language.

SELECT DATENAME( weekday, SYSDATETIME() ) as cdayname
, DATEPART( weekday, SYSDATETIME() ) ;

ee8

SET LANGUAGE Polish;
SELECT DATENAME( weekday, SYSDATETIME() ) as [day in Polish]
, DATEPART( weekday, SYSDATETIME() ) ;

ee1

SET LANGUAGE Japanese;
SELECT DATENAME( weekday, SYSDATETIME() ) as [day in Japanese]
, DATEPART( weekday, SYSDATETIME() ) ;

ee2

SET LANGUAGE Spanish;
SELECT DATENAME( weekday, SYSDATETIME() ) as [day in Spanish]
, DATEPART( weekday, SYSDATETIME() ) ;

ee3

SET LANGUAGE Czech;
SELECT DATENAME( weekday, SYSDATETIME() ) as [day in Czech]
, DATEPART( weekday, SYSDATETIME() ) ;

ee4

SET LANGUAGE Hungarian;
SELECT DATENAME( weekday, SYSDATETIME() ) as [day in Hungarian]
, DATEPART( weekday, SYSDATETIME() ) ;

ee5

SET LANGUAGE 'Traditional Chinese';
SELECT DATENAME( weekday, SYSDATETIME() ) as [day in Traditional Chinese]
, DATEPART( weekday, SYSDATETIME() ) ;

ee6

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.