Hello, I am trying to retrieve data from multiple tables (around 30 tables) in MS SQL server and check for different dates. Those tables have the same alias (timestamp) like _20230612 is same for every single table.
For example, the input tables (30) are like below and will be union together for checking.
Staging_A_20230612
Staging_B_20230612
Staging_C_20230612
Staging_D_20230612
Since I need to update the table alias (_20230612) for each checking and I have tons of table to update, is anyone knowing how to update the timestamp once and have all my 30 table names updated So I don't have to update all the table names manually each time. Thank you so much!
for example I input 20230611 then all my input get updated to:
Staging_A_20230611
Staging_B_20230611
Staging_C_20230611
Stagng_D_20230611