| title | Duplicate Tables | |||||
|---|---|---|---|---|---|---|
| description | Create a duplicate copy of a table in the SQL Database Engine. | |||||
| author | WilliamDAssafMSFT | |||||
| ms.author | wiassaf | |||||
| ms.date | 08/07/2025 | |||||
| ms.service | sql | |||||
| ms.subservice | table-view-index | |||||
| ms.topic | how-to | |||||
| ms.custom |
|
|||||
| helpviewer_keywords |
|
|||||
| monikerRange | >=aps-pdw-2016 || =azuresqldb-current || =azure-sqldw-latest || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric-sqldb |
[!INCLUDE sqlserver2016-asdb-asdbmi-asa-pdw-fabricsqldb]
You can duplicate an existing table in [!INCLUDEssnoversion] by using [!INCLUDEssManStudioFull] or [!INCLUDEtsql] by creating a new table and then copying column information from an existing table.
These steps described duplicate only the structure of a table, not the row data.
Requires CREATE TABLE permission in the destination database.
-
Make sure you are connected to the database in which you want to create the table and that the database is selected in Object Explorer.
-
In Object Explorer, right-click Tables and select New and then Table....
-
In Object Explorer right-click the table you want to copy, and select Design. The existing table opens in a separate tab.
-
Select the columns in the existing table and, from the Edit menu, select Copy, or
Ctrl+Cto copy the column information to your clipboard. -
Switch back to the new table tab and select the first column of the first row.
-
From the Edit menu, select Paste or
Ctrl+Vto paste. -
From the File menu, select Save table name, or
Ctrl+Sto save. -
In the Choose Name dialog box, type a name for the new table. Select OK. The table will be created and visible in the Object Explorer.
-
Make sure you are connected to the database in which you want to create the table and that the database is selected in Object Explorer.
-
Right-click the table you wish to duplicate, point to Script Table as, then point to CREATE to, and then select New Query Editor Window.
-
Change the name of the table.
-
Remove any columns that are not needed in the new table.
-
Select Execute to create the new table. The table will be created and visible in the Object Explorer.