campinam
asked on
SET NOCOUNT OFF - how to capture returned messages
Suppose I SET NOCOUNT OFF in a stored procedure; I know it's not recommended, but just suppose that for a moment.
The stored procedure performs numerous deletes, updates, inserts. After each of those a message is returned to the caller (in this case ADO.NET) containing the number of records affected.
How do I capture, in ADO.NET, such returned messages (a large number of such messages) ??
The stored procedure performs numerous deletes, updates, inserts. After each of those a message is returned to the caller (in this case ADO.NET) containing the number of records affected.
How do I capture, in ADO.NET, such returned messages (a large number of such messages) ??
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I agree with that method being the best!
ASKER
Thank you!
Can I capture the same info (rows affected) using SET NOCOUNT OFF and messages it returns (this was the point of my question) - how do I capture messages caused by SET NOCOUNT OFF (maybe that's not possible??)
Can I capture the same info (rows affected) using SET NOCOUNT OFF and messages it returns (this was the point of my question) - how do I capture messages caused by SET NOCOUNT OFF (maybe that's not possible??)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you have SET NOCOUNT OFF you can use ExecteNonQuery to get the value, however it will only be the last one.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.