Ole Automation Procedures 选项

使用 Ole Automation Procedures 选项可指定是否可以在 Transact-SQL 批处理中实例化 OLE Automation 对象。还可以使用基于策略的管理或者 sp_configure 存储过程来配置这一选项。有关详细信息,请参阅了解外围应用配置器

可以将 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