How to copy a table structure from one database to another
I am looking for the same solution. I tried below example it worked, go to the database where you want to create a table and try like below example.
CREATE TABLE new_table_name LIKE database.table_name
This example will create a table with AI, Index, Key. its something like duplicate table structure.
Following line of code should do the job:
create table new_table_name like existing_table_name;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With