配置默认语言服务器配置选项Configure the default language Server Configuration Option

适用对象:是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

本主题说明了如何使用 SQL ServerSQL Server 中配置 SQL Server Management StudioSQL Server Management Studio “默认语言” Transact-SQLTransact-SQL服务器配置选项。This topic describes how to configure the default language server configuration option in SQL ServerSQL Server by using SQL Server Management StudioSQL Server Management Studio or Transact-SQLTransact-SQL. “默认语言” 选项指定所有新创建的登录名的默认语言。The default language option specifies the default language for all newly created logins. 若要设置默认语言,请指定所需语言的 langid 值。To set default language, specify the langid value of the language you want. 可通过查询 sys.syslanguages 兼容性视图来获取 langid 值。The langid value can be obtained by querying the sys.syslanguages compatibility view.

本主题内容In This Topic

开始之前Before You Begin

建议Recommendations

  • 可以使用 CREATE LOGIN 或 ALTER LOGIN 替代登录的默认语言。The default language for a login can be overridden by using CREATE LOGIN or ALTER LOGIN. 会话的默认语言是该会话登录的语言,除非使用开放式数据库连接 (ODBC) 或 OLE DB API 替代每个会话的默认语言。The default language for a session is the language for that session's login, unless overridden on a per-session basis by using the Open Database Connectivity (ODBC) or OLE DB APIs. 请注意,只能将 “默认语言”选项设置为 sys.syslanguages 中定义的语言 ID (0-32)。Note that you can only set the default language option to a language ID defined in sys.syslanguages (0-32). 在使用包含数据库时,可使用 CREATE DATABASE 或 ALTER DATABASE 设置数据库的默认语言,使用 CREATE USER 或 ALTER USER 设置包含数据库用户的默认语言。When you are using contained databases, a default language can be set for a database by using CREATE DATABASE or ALTER DATABASE, and for contained database users by using CREATE USER or ALTER USER. 在包含数据库中设置默认语言时,接受 sys.syslanguages 中所列的 langid值、语言名称或语言别名。Setting default languages in a contained database accepts langid value, the language name, or a language alias as listed in sys.syslanguages.

SecuritySecurity

权限Permissions

默认情况下,所有用户都具备不带参数或仅带第一个参数的 sp_configure 的执行权限。Execute permissions on sp_configure with no parameters or with only the first parameter are granted to all users by default. 若要执行带两个参数的 sp_configure 以更改配置选项或运行 RECONFIGURE 语句,则用户必须具备 ALTER SETTINGS 服务器级别的权限。To execute sp_configure with both parameters to change a configuration option or to run the RECONFIGURE statement, a user must be granted the ALTER SETTINGS server-level permission. ALTER SETTINGS 权限由 sysadminserveradmin 固定服务器角色隐式持有。The ALTER SETTINGS permission is implicitly held by the sysadmin and serveradmin fixed server roles.

使用 SQL Server Management StudioUsing SQL Server Management Studio

配置默认语言选项To configure the default language option

  1. 在对象资源管理器中,右键单击服务器并选择 “属性”In Object Explorer, right-click a server and select Properties.

  2. 单击“高级” 选项卡。Click the Advanced tab.

  3. 在“默认语言” 框中,选择 MicrosoftMicrosoft SQL ServerSQL Server 显示系统消息所用的语言。In the Default language box, choose the language in which MicrosoftMicrosoft SQL ServerSQL Server should display system messages.

    默认语言为英语。The default language is English.

使用 Transact-SQLUsing Transact-SQL

配置默认语言选项To configure the default language option

  1. 连接到 数据库引擎Database EngineConnect to the 数据库引擎Database Engine.

  2. 在标准菜单栏上,单击 “新建查询”From the Standard bar, click New Query.

  3. 将以下示例复制并粘贴到查询窗口中,然后单击“执行” 。Copy and paste the following example into the query window and click Execute. 此示例说明如何使用 sp_configuredefault language 选项配置为 French (2)。This example shows how to use sp_configure to configure the default language option to French (2).

USE AdventureWorks2012 ;  
GO  
EXEC sp_configure 'default language', 2 ;  
GO  
RECONFIGURE ;  
GO  

有关详细信息,请参阅 服务器配置选项 (SQL Server)版本的组合自动配置的最大工作线程数。For more information, see Server Configuration Options (SQL Server).

跟进:在配置默认语言选项之后Follow Up: After you configure the default language option

该设置将立即生效,无需重新启动服务器。The setting takes effect immediately without restarting the server.

另请参阅See Also

CREATE LOGIN (Transact-SQL) CREATE LOGIN (Transact-SQL)
ALTER LOGIN (Transact-SQL) ALTER LOGIN (Transact-SQL)
CREATE USER (Transact-SQL) CREATE USER (Transact-SQL)
ALTER USER (Transact-SQL) ALTER USER (Transact-SQL)
CREATE DATABASE (SQL Server Transact-SQL) CREATE DATABASE (SQL Server Transact-SQL)
ALTER DATABASE (Transact-SQL) ALTER DATABASE (Transact-SQL)
RECONFIGURE (Transact-SQL) RECONFIGURE (Transact-SQL)
服务器配置选项 (SQL Server) Server Configuration Options (SQL Server)
sp_configure (Transact-SQL)sp_configure (Transact-SQL)