SET LANGUAGE (Transact-SQL)
Applies To: SQL Server 2014, SQL Server 2016 Preview
Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
Specifies the language environment for the session. The session language determines the datetime formats and system messages.
Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.
The setting of SET LANGUAGE is set at execute or run time and not at parse time.
SET LANGUAGE implicitly sets the setting of SET DATEFORMAT.
The following example sets the default language to Italian, displays the month name, and then switches back to us_english and displays the month name again.
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