I have nested while loops with a transaction in the inner loop, e.g.:
WHILE -- A
BEGIN
WHILE -- B
BEGIN
-- tx here
END
END
I need to shift control from the inner loop (B) to the outer loop (A) if the transaction fails.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Obviously pseudo but the important part is the
BREAK; insideCATCH. How it behaves, though, will depend on the error level / severity of the actual failure.P.S. the absolute bible on error handling was written by Erland Sommarskog, you should definitely put it in your bookmarks:
http://www.sommarskog.se/error_handling_2005.html