sys.sp_oadestroy
generalDescription
Destroys a created OLE object. The object token of an OLE object that was previously created by using (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 Arguments for extended stored procedures must be entered in the specific order as described in the section. If the parameters are entered out of order, an error message occurs.
Syntax
sp_
OAD estroy objecttoken
[ ; ]
Remarks
Destroys a created OLE object.
The object token of an OLE object that was previously created by using
(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
Arguments for extended stored procedures must be entered in the specific order as
described in the
section. If the parameters are entered out of order, an error
message occurs.
Examples
Example 1
sp_OADestroy
Example 2
SQLServer
Example 3
EXECUTE
@hr = sp_OADestroy
@
object
;
IF @hr <> 0
BEGIN
EXECUTE sp_OAGetErrorInfo @
object
;
RETURN;
END