Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- USE employee_at_alansweb;
- -- Loop through each table and create the copy in the new database
- -- This query will give you the required `CREATE TABLE` statements for all tables in the database.
- SHOW TABLES;
- -- For each table (e.g., table1, table2, etc.)
- CREATE TABLE employee_.table1 LIKE employee_at_alansweb.table1;
- INSERT INTO employee_.table1 SELECT * FROM employee_at_alansweb.table1;
- CREATE TABLE employee_.table2 LIKE employee_at_alansweb.table2;
- INSERT INTO employee_.table2 SELECT * FROM employee_at_alansweb.table2;
- -- Continue for all tables in the database
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement