I know that the question of how to update multiple tables in SQL has been asked before, and the general answer seems to make them separately in the transaction.
However, the two columns that I need to update have a foreign key, so they cannot be updated separately.
eg.
Table1.a is a foreign key for Table2.a
One of the entries in the tables is invalid, for example. both columns are "xxx" and must be "yyy"
How to update Table1.a and Table2.a to be "yyy"?
I know that I could temporarily remove the key and replace, but, of course, a different way.
thank
source
share