OLE automation return codes and error information
Applies to:
SQL Server
The OLE automation system stored procedures return an int return code that is the HRESULT returned by the underlying OLE automation operation. An HRESULT of 0 indicates success. A nonzero HRESULT is an OLE error code of the hexadecimal form 0x800nnnnn, but when returned as an int value in a stored procedure return code, HRESULT has the form -214nnnnnnn.
Example
For example, passing an invalid object name (SQLDMO.Xyzzy) to sp_OACreate causes the procedure to return an int HRESULT of 2147221005, which is 0x800401f3 in hexadecimal.
You can use CONVERT(binary(4), @hresult)
to convert an int HRESULT to a binary value.
For examples of supported conversion, see H. Using CONVERT with binary and character data.
Next steps
Tilbakemeldinger
https://aka.ms/ContentUserFeedback.
Kommer snart: Gjennom 2024 faser vi ut GitHub Issues som tilbakemeldingsmekanisme for innhold, og erstatter det med et nytt system for tilbakemeldinger. Hvis du vil ha mer informasjon, kan du se:Send inn og vis tilbakemelding for