Sets a property of an OLE object to a new value.
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 sets the HostName property (of the previously created SQLServer object) to a new value.
EXEC @hr = sp_OASetProperty @object, 'HostName', 'Gizmo'; IF @hr <> 0 BEGIN EXEC sp_OAGetErrorInfo @object RETURN END'