Transact-SQL Reference

sp_defaultlanguage

Changes the default language of a login.

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 Microsoft® SQL Server™ login or a Microsoft Windows NT® user or group. If the Windows NT user or group does not exist in SQL Server, it is automatically added.

[@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. language remains the same as the default language used when sp_defaultlanguage was executed.

Return Code Values

0 (success) or 1 (failure)

Remarks

A default language can be set by using either sp_defaultlanguage or sp_addlogin when the login is initially added to SQL Server. Use sp_helplanguage to display a list of the valid language options.

Any user can use the SET LANGUAGE statement to change the language setting for the duration 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 default language of the server is used as the initial language setting, and a message is displayed.

sp_defaultlanguage cannot be executed within a user-defined transaction.

Permissions

Execute permissions default to the public role for users changing the default language for their login. Only members of the sysadmin or securityadmin fixed server roles can execute sp_defaultlanguage for other logins.

Examples

This example sets the default language for login Claire to French.

EXEC sp_defaultlanguage 'Claire', 'french'

See Also

@@LANGUAGE

SET

sp_addlogin

sp_helplanguage

System Stored Procedures