Applies To: SQL Server 2014, SQL Server 2016 Preview
Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
Destroys a created OLE object.
Applies to: SQL Server (SQL Server 2008 through current version).
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.
The following example destroys the previously created SQLServer object.
EXEC @hr = sp_OADestroy @object; IF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @object RETURN END;