Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Technical Reference
SET (Transact-SQL)
 SET LANGUAGE (Transact-SQL)
Community Content
In this section
Statistics Annotations (0)
Collapse All/Expand All Collapse All
Other versions are also available for the following:
SQL Server 2008 Books Online (November 2009)
SET LANGUAGE (Transact-SQL)

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

Topic link icon Transact-SQL Syntax Conventions

SET LANGUAGE { [ N ] 'language' | @language_var } 
[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.

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.

Requires membership in the public role.

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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker