Skip to content

Latest commit

 

History

History
77 lines (59 loc) · 3.02 KB

File metadata and controls

77 lines (59 loc) · 3.02 KB
description SET LANGUAGE (Transact-SQL)
title SET LANGUAGE (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 06/05/2017
ms.prod sql
ms.prod_service synapse-analytics, database-engine, sql-database
ms.reviewer
ms.technology t-sql
ms.topic reference
f1_keywords
SET_LANGUAGE_TSQL
SET LANGUAGE
dev_langs
TSQL
helpviewer_keywords
LANGUAGE option
languages [SQL Server], setting language
SET LANGUAGE statement
options [SQL Server], date
default languages
ms.assetid 0ec0e5cf-e115-4be9-a0db-e65837d6fa45
author WilliamDAssafMSFT
ms.author wiassaf
monikerRange =azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current

SET LANGUAGE (Transact-SQL)

[!INCLUDE sql-asdb-asdbmi-asa-pdw]

Specifies the language environment for the session. The session language determines the datetime formats and system messages.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
SET LANGUAGE { [ N ] 'language' | @language_var }   

[!INCLUDEsql-server-tsql-previous-offline-documentation]

Arguments

[N]'language' | @language_var
Is the name of the language as stored in sys.syslanguages. This argument can be either Unicode or DBCS converted to Unicode. To specify a language in Unicode, use N'language'. If specified as a variable, the variable must be sysname.

Remarks

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.

Permissions

Requires membership in the public role.

Examples

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  

See Also

Data Types (Transact-SQL)
syslanguages
sp_helplanguage (Transact-SQL)
SET Statements (Transact-SQL)