Ole Automation Procedures(服务器配置选项)

适用于:SQL Server

使用“OLE 自动化过程”选项可指定是否可以在 Transact-SQL 批处理中实例化 OLE 自动化对象。 还可以使用基于策略的管理或者 sp_configure 存储过程来配置这一选项。 有关详细信息,请参阅 Surface Area Configuration

可以将 Ole Automation Procedures 选项设置为以下值。

0
禁用 OLE Automation Procedures。 SQL Server新实例的默认值。

1
启用 OLE Automation Procedures。

当启用 OLE Automation Procedures 时,对 sp_OACreate 的调用将会启动 OLE 共享执行环境。

可以使用 sp_configure 系统存储过程来查看和更改 Ole Automation Procedures 选项的当前值。

示例

以下示例显示了如何查看 OLE Automation Procedures 的当前设置。

EXEC sp_configure 'Ole Automation Procedures';  
GO  

以下示例显示了如何启用 OLE Automation Procedures。

sp_configure 'show advanced options', 1;  
GO  
RECONFIGURE;  
GO  
sp_configure 'Ole Automation Procedures', 1;  
GO  
RECONFIGURE;  
GO  

另请参阅

sp_configure (Transact-SQL)
RECONFIGURE (Transact-SQL)
外围应用配置器
服务器配置选项 (SQL Server)