sp_OAStop
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.
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.
Permissions
Only members of the sysadmin fixed server role can execute sp_OAStop.
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 create an OLE Automation object (Transact-SQL)