Could you please give the command to add a column to all the tables if the table doesn't contain that column in a schema?
e.g. The schema schema1
contains 50 tables in which 20 tables contain a column named colTest
.
I need to add the column colTest
to the remaining 30 tables.
Best Answer
You can do this with a loop and dynamic SQL: