SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for ASP.Net, SQL Server, Reporting Services, T-SQL, Windows, AWS, SAP HANA and ABAP


Get Day Names and Month Names in Different Language

Set Language SQL command and DateName built-in SQL datetime function enables developers to get day names and month names in specific language. In this T-SQL tutorial, SQL developers and SQL Server database administrators can find code samples to get descriptions like day names of a week or month names of a year in previously selected language like a translation on SQL Server.

SQL developers can use following T-SQL statements including "Set Language" for setting a specific language which the day and month names will be automatically translated into. SQL DateName datetime function is used to return text descriptions of months or week days in SQL Server database development.

SET LANGUAGE US_English
SELECT DATENAME(dw, GETDATE()) day, DATENAME(mm, GETDATE()) month

SET LANGUAGE Turkish
SELECT DATENAME(dw, GETDATE()) day, DATENAME(mm, GETDATE()) month

SET LANGUAGE French
SELECT DATENAME(dw, GETDATE()) day, DATENAME(mm, GETDATE()) month

SET LANGUAGE German
SELECT DATENAME(dw, GETDATE()) day, DATENAME(mm, GETDATE()) month

SET LANGUAGE Italian
SELECT DATENAME(dw, GETDATE()) day, DATENAME(mm, GETDATE()) month

SET LANGUAGE Russian
SELECT DATENAME(dw, GETDATE()) day, DATENAME(mm, GETDATE()) month
Code

SQL Select with Set Language for day and month name translations
SQL Select with Set Language for day and month name translations

The output of the above Select statements are as seen in below screenshot.

day and month names using DateName and Set Language SQL commands
Day names and month names in selected languages by SQL Server built-in DateName() datetime function



SQL Server

SQL Server 2019 Installation
download SQL Server 2019
download SQL Server 2017
download SQL Server 2016
download SQL Server 2014
download SQL Server 2012
MacOS ve SQL Server 2019


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.