T-SQL Tutorial

T-SQL SET Language


T-SQL SET Language - sets the language of session.
The session language establish the format of date and system messages.

SET Language Syntax:

SET LANGUAGE { [ N ] 'language' | @language_variable } ;

SET Language Example:

USE model;
GO
DECLARE @MyDay DATETIME;
SET @MyDay = '06/21/2014';

SET LANGUAGE French;
SELECT DATENAME(month, @MyDay) AS 'French Month';

SET LANGUAGE English;
SELECT DATENAME(month, @MyDay) AS 'English Month' ;
GO

French Month
Juin
English Month
June