“代理 XP”服务器配置选项Agent XPs 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

使用 Agent XPs 选项可以启用此服务器上的 SQL ServerSQL Server 代理扩展存储过程。Use the Agent XPs option to enable the SQL ServerSQL Server Agent extended stored procedures on this server. 如果禁用此选项,则 SQL ServerSQL Server 对象资源管理器将不显示 SQL Server Management StudioSQL Server Management Studio 代理节点。When this option is not enabled, the SQL ServerSQL Server Agent node is not available in SQL Server Management StudioSQL Server Management Studio Object Explorer.

使用 SQL Server Management StudioSQL Server Management Studio 工具启动 SQL ServerSQL Server 代理服务时,会自动启用这些扩展的存储过程。When you use the SQL Server Management StudioSQL Server Management Studio tool to start the SQL ServerSQL Server Agent service, these extended stored procedures are enabled automatically. 有关详细信息,请参阅 Surface Area ConfigurationFor more information, see Surface Area Configuration.

备注

Management StudioManagement Studio 除非这些扩展存储过程在 SQL ServerSQL Server 代理服务处于任何状态下都启用,否则对象资源管理器不会显示 SQL ServerSQL Server 代理节点的内容。Object Explorer does not display the contents of the SQL ServerSQL ServerAgent node unless these extended stored procedures are enabled regardless of the SQL ServerSQL Server Agent service state.

可能的值有:The possible values are:

  • 0,表示 SQL ServerSQL Server 代理扩展存储过程不可用(默认值)。0, indicating that SQL ServerSQL Server Agent extended stored procedures are not available (the default).

  • 1,表示 SQL ServerSQL Server 代理扩展存储过程可用。1, indicating that SQL ServerSQL Server Agent extended stored procedures are available.

该设置立即生效,无需停止并重新启动服务器。The setting takes effect immediately without a server stop and restart.

示例Example

下面的示例启用 SQL ServerSQL Server 代理扩展存储过程。The following example enables the SQL ServerSQL Server Agent extended stored procedures.

  1. 在 Microsoft SQL Server Management Studio 中连接到数据库引擎。From Microsoft SQL Server Management Studio connect 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_configure 'show advanced options', 1;  
GO  
RECONFIGURE;  
GO  
sp_configure 'Agent XPs', 1;  
GO  
RECONFIGURE  
GO  

另请参阅See Also

自动执行管理任务(SQL Server 代理) Automated Administration Tasks (SQL Server Agent)
启动、停止或暂停 SQL Server 代理服务Start, Stop, or Pause the SQL Server Agent Service