I am trying to write a SQL update query which will loop through several tables and update values.
I have a cus_no in several tables and I want to create a temporary table in SQL with the old cus_no and the new cus_no value and have loop through a list of tables and change the values in each of those tables.
old_cus | new_cus
A1 | B1
A2 | B3
A3 | C1
A4 | D47
and have it loop through tables like
So it would change the values in each of those tables to the new values from the temptable.
Is that possible?