mentioned above:
Article from Baidu Experience
Operation:
In the process of using SQL Server, we may need to copy the table from one database to another, and today we will introduce the specific methods and steps for this operation.
Duplicate table structure
- 1
First, open and connect to SQL Server, right-click the source database source_db (the source database name), and then tap "Write table script" → "Create to" → "New Query Editor window".
- 2
Press "Crtl+a" in the editor generated by the 1th step to select all the contents, then right-click "Copy" (or press "Crtl+c" key).
- 3
Create a new query, then right-paste (or CTRL + V), and change the source_db (source database name) in your code to TARGET_DB (the target database name). Then right-click Execute to execute the code.
- 4
You can then see the tables that were copied in the table structure of the target database.
END
Data content replication for tables
Select the target database target_db, then click "Tasks" → "Import data".
Go to the SQL Server Import and Export Wizard and follow the instructions.
Select a data source (source database).
Select target (target database), specify table copy, or query.
Select source table and Source view: After you set the source and destination tables, click the Edit Mappings button and select Enable Identity insertion in the pop-up window. (Otherwise an error will occur later)
Always click "Next" to finalize the operation.
SQL Server copies the tables in the database to another database