Friday, February 24, 2012

checking success of a request in a stored procedure

Hi,
Say I have a stored procedure which does two INSERT operation.
How can I check if the first INSERT succeeded in order to know if I
should carry on and do the second one ?

RegardsYou can check @.@.ERROR to see if an error was raised, or @.@.ROWCOUNT to
see how many rows were inserted - in some cases you might consider it
an error if no rows were inserted.

See here for much more information:

http://www.sommarskog.se/error-handling-II.html

Simon

No comments:

Post a Comment