sp_OAStop (T-SQL)

Stops the server-wide OLE Automation stored procedure execution environment.

Syntax

sp_OAStop

Return Code Values

0 (success) or a nonzero number (failure) that is the integer value of the HRESULT returned by the OLE Automation object.

For more information about HRESULT Return Codes, see OLE Automation Return Codes and Error Information.

Result Sets

None

Remarks

After Microsoft® SQL Server™ is started, the shared OLE Automation stored procedure execution environment is automatically started when sp_OACreate is first called by a client. A single execution environment is shared by all clients using the OLE Automation stored procedures.

It is not necessary to call sp_OAStop. If sp_OAStop is not called, the execution environment is automatically stopped when SQL Server is shut down. After the execution environment has been stopped, any call to sp_OACreate restarts the execution environment.


Note If one client calls sp_OAStop to stop the execution environment, any client currently executing a statement batch that uses the OLE Automation stored procedures receives an error message when any OLE Automation stored procedure (except sp_OACreate) is called.


Examples

This example stops the shared OLE Automation execution environment.

EXEC sp_OAStop

  

See Also
Data Type Conversions Using OLE Automation Stored Procedures How to debug a custom OLE Automation server (Transact-SQL)
How to create an OLE Automation object (Transact-SQL) OLE Automation Sample Script


(c) 1988-98 Microsoft Corporation. All Rights Reserved.