SQL LANGUAGE

The SQL LANGUAGE is one of the Set Function, which will set the Language or change the default language. This Set language Statement determines the system message and DateTime format. The syntax of the SET LANGUAGE is

SET LANGUAGE Language_Name

-- For example,
SET LANGUAGE French;

SQL SET LANGUAGE Example

In this example, we will show you, How the SET LANGUAGE will affect the DateTime and message formats. If you find it challenging to understand the language names, then use the sp_helplanguage stored procedure.

SELECT DATENAME(month, GETDATE()) AS 'Month Name'

SET LANGUAGE French
SELECT DATENAME(month, GETDATE()) AS 'Month Name'

SET LANGUAGE Italian
SELECT DATENAME(month, GETDATE()) AS 'Month Name'
SQL LANGUAGE Example 1

Let me show you the SQL Server system messages. For this, we are selecting divide by zero statement

SET LANGUAGE English
SELECT 1/0 

SET LANGUAGE French
SELECT 1/0 

SET LANGUAGE Italian
SELECT 1/0

You can see the message in different languages.

SQL LANGUAGE Example 2