Stops the server-wide OLE Automation stored procedure execution environment.
sp_OAStop
After 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 will restart 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 will receive an error when any OLE Automation stored procedure (except sp_OACreate) is called.
This example stops the shared OLE Automation execution environment.
EXEC sp_OAStop