For every week I have excel sheet converted to SQL database this excel sheet gave me 30 deference table with same structure and field definition but there is no relationship between these tables.
So I want to merge the data from these 30 table in one table I’m trying to write T-sql to do this but I fail by using INFORMATION_SCHEMA.Tables or sys.tables to get the table names and proceed to fetch data from these tables in one query.
To combine tables together with the exact same schema:
If your entire DB is made up of these tables you should be able to use the
sp_msforeachtableprocedure.