OLE Automation 程序伺服器組態選項Ole Automation Procedures Server Configuration Option

適用於: 是SQL Server 否Azure SQL Database 否Azure Synapse Analytics (SQL DW) 否平行處理資料倉儲 APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

使用 [OLE Automation 程序] 選項可指定 OLE Automation 物件是否可在 Transact-SQLTransact-SQL 批次內部啟動。Use the Ole Automation Procedures option to specify whether OLE Automation objects can be instantiated within Transact-SQLTransact-SQL batches. 您也可以使用以原則為基礎的管理或 sp_configure 預存程序來設定這個選項。This option can also be configured using the Policy-Based Management or the sp_configure stored procedure. 如需詳細資訊,請參閱< Surface Area Configuration>。For more information, see Surface Area Configuration.

[Ole Automation 程序] 選項可以設定為下列值。The Ole Automation Procedures option can be set to the following values.

停用 OLE Automation Procedures。OLE Automation Procedures are disabled. 這是 SQL ServerSQL Server新執行個體的預設值。Default for new instances of SQL ServerSQL Server.

啟用 OLE Automation Procedures。OLE Automation Procedures are enabled.

啟用 OLE Automation 程序時,對 sp_OACreate 的呼叫會啟動 OLE 共用執行環境。When OLE Automation Procedures are enabled, a call to sp_OACreate will start the OLE shared execution environment.

您可以使用 sp_configure 系統預存程序來檢視和變更 [OLE Automation 程序] 選項目前的值。The current value of the Ole Automation Procedures option can be viewed and changed by using the sp_configure system stored procedure.


下列範例顯示如何檢視 OLE Automation Procedures 的目前設定。The following example shows how to view the current setting of OLE Automation procedures.

EXEC sp_configure 'Ole Automation Procedures';  

下列範例顯示如何啟用 OLE Automation Procedures。The following example shows how to enable OLE Automation procedures.

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

另請參閱See Also

sp_configure (Transact-SQL) sp_configure (Transact-SQL)
Surface Area Configuration Surface Area Configuration
伺服器組態選項 (SQL Server)Server Configuration Options (SQL Server)