Reputation: 669
I would like to copy all data from one schema (a) to another (b). Two schemas have the same structure.
I use
Insert into a.table1 select * from b.table1;
But there are 254 tables in a and listing them is very frustrated.
Do you have any better solution?
Thanks
Upvotes: 1
Views: 934
Reputation: 11205
2 options...
1) Use dynamic SQL to loop through the results of:
select TABLE_NAME from information_schema.tables
2) Output the results of that query into excel, build your inserts from that then run them in a big old proc.
Upvotes: 1