I have a large number of tables (some thousands) containing similar data. I would like to run some reports from these. The table names are similar, so I can get a list of table
select 'select * from '+TABLE_NAME +' union all' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%chd%' ORDER BY TABLE_NAME
remove last union all