I have two tables with the same ID column PK/FK. I need to update them with data from a third table.
IF EXISTS (SELECT * C, B WHERE B2 = C4 AND C6 = NULL)
Update A
Set A2=C2,
A3=C3,
B2=C4,
B3=C5
From C
Where C6 = NULL
How do I put the join in to link the proper B row to the A row? I can elminiate the last where statement as it is limited by that criteria already, correct?
You cannot update two tables at once, you can simply wrap two update statements in a
TRANSACTION.: