Avatar of TomPreen
TomPreen
 asked on

SQL transaction query

I have a coded process for a SQL transaction that updates multiple tables :-
BEGIN TRANSACTION
update table 1
If succeeds
       update table 2
       if succeeds
           COMMIT TRANSACTION
       else
           ROLLBACK TRANSACTION
       endif
endif

On checking the data only table 2 is updated.
Please advise what I am missing.
SQL

Avatar of undefined
Last Comment
Kyle Abrahams, PMP

8/22/2022 - Mon
Raja Jegan R

Above pseudocode seems to be fine..
Can you post your problematic script to check and confirm..
ASKER CERTIFIED SOLUTION
Kyle Abrahams, PMP

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck