sql - How to combine identical tables into one table? -


i have 100s of millions of unique rows spread across 12 tables in same database. have same schema/columns. there relatively easy way combine of separate tables 1 table?

i've tried importing tables single table, given huge size of files/rows, sql server making me wait long time if importing flat file. there has easier/faster way, no?

you haven't given info table structure, can plain old insert select, below. example take records don't exist table2 , table3, , insert them table1. merge 12 tables single table.

insert table1 select * table2 someuniquekey not in (select someuniquekey table1) union select * table3 someuniquekey not in (select someuniquekey table1) --... 

Comments