Sets a property of an OLE object to a new value.
sp_OASetProperty objecttoken, propertyname, newvalue [, index...]
where
Some properties have parameters. They are called indexed properties, and the parameters are called index parameters. A property can have multiple index parameters.
This procedure returns a 0 when successful or a non-zero HRESULT when an error occurs.
This 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_displayoaerrorinfo @object, @hr RETURN END