First, the table structure of a table needs to be copied from one data (a) library to another database (B). The operation step is as follows:
① in Database A, select the tables that you want to replicate. Right-Select the Edit table script to creat to the new Query editing window.
② in the newly opened Query window, use CTRL + A to copy the script after you select all.
③ opens a new query. Paste the copied script into the new query page. and modify the database name in the first row of the script to the target database (database B) name. Click Execute this script.
④ can see the table being copied in the table structure of the target database (database B).
Second, it is necessary to copy the contents of a table from one database (a) to another database (B). The operation step is as follows:
① Select Target Database (B), right-click: task---import data.
② follow the SQL Server Import and Export Wizard. Fill in the corresponding source and target table information. As shown in the following:
③ can see that in the target database, the Int_browermark table structure of the source database is copied to the target database along with the data.
SQL Server copies the tables in the database to another database