Skip to content

Latest commit

 

History

History
78 lines (59 loc) · 3.68 KB

File metadata and controls

78 lines (59 loc) · 3.68 KB
description sp_defaultlanguage (Transact-SQL)
title sp_defaultlanguage (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology system-objects
ms.topic reference
f1_keywords
sp_defaultlanguage
sp_defaultlanguage_TSQL
dev_langs
TSQL
helpviewer_keywords
sp_defaultlanguage
ms.assetid 908d01cc-e704-45d9-9e85-d2df6da3e6f5
author markingmyname
ms.author maghan

sp_defaultlanguage (Transact-SQL)

[!INCLUDE SQL Server]

Changes the default language of for a [!INCLUDEssNoVersion] login.

Important

[!INCLUDEssNoteDepFutureAvoid] Use ALTER LOGIN instead.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sp_defaultlanguage [ @loginame = ] 'login'   
     [ , [ @language = ] 'language' ]   

Arguments

[ @loginame = ] 'login' Is the login name. login is sysname, with no default. login can be an existing [!INCLUDEssNoVersion] login or a Windows user or group.

[ @language = ] 'language' Is the default language of the login. language is sysname, with a default of NULL. language must be a valid language on the server. If language is not specified, language is set to the server default language; default language is defined by the sp_configure configuration variable default language. Changing the server default language does not change the default language for existing logins.

Return Code Values

0 (success) or 1 (failure)

Remarks

sp_defaultlanguage calls ALTER LOGIN, which supports additional options. For information about changing other login defaults, see ALTER LOGIN (Transact-SQL).

Use the SET LANGUAGE statement to change the language of the current session. Use the @@LANGUAGE function to show the current language setting.

If the default language of a login is dropped from the server, the login acquires the default language of the server. sp_defaultlanguage cannot be executed within a user-defined transaction.

Information about languages installed on the server is visible in the sys.syslanguages catalog view.

Permissions

Requires ALTER ANY LOGIN permission.

Examples

The following example uses ALTER LOGIN to change the default language for login Fathima to Arabic. This is the preferred method.

ALTER LOGIN Fathima WITH DEFAULT_LANGUAGE = Arabic;  
GO  

See Also

Security Stored Procedures (Transact-SQL)
ALTER LOGIN (Transact-SQL)
@@LANGUAGE (Transact-SQL)
SET Statements (Transact-SQL)
sys.syslanguages (Transact-SQL)
System Stored Procedures (Transact-SQL)