This article was co-authored by wikiHow staff writer, Darlene Antonelli, MA. Darlene Antonelli is a Technology Writer and Editor for wikiHow. Darlene has experience teaching college courses, writing technology-related articles, and working hands-on in the technology field. She earned an MA in Writing from Rowan University in 2012 and wrote her thesis on online communities and the personalities curated in such communities.
This article has been viewed 7,689 times.
Learn more...
Need to create a new SQL table based on the structure of an existing table? This wikiHow article will teach you how to duplicate an existing SQL table in SQL Server Management Studio and Transact SQL.
Steps
Using SQL Server Management Studio
-
1Connect to the database you want to modify. If you haven't already, you'll also need to select your database in Object Explorer.
-
2Right-click Tables and select New Table. You'll only see this if you're in Object Explorer.Advertisement
-
3Right-click the table you want to copy and select Design. As soon as you click this, you'll be asked to create the table's parameters.
-
4Select the columns in the original table and select Copy. The Copy button is inside the Edit toolbar menu item.
-
5Navigate to where you want the new table to be and select the first row.
-
6Paste the copied data. From the Edit menu, select Paste to enter the data from your clipboard to your selected cells.
-
7Save your file. Once the table is pasted into a new table, you can go to the File menu and click Save. Your file manager will open so you can name the file and save it to a specific location.[1]
Using Transact-SQL
-
1Connect to the database you want to modify. If you haven't already, you'll also need to select your database in Object Explorer.
-
2Right-click the table you want to copy and select Script Table as. Another menu will expand.
-
3Select CREATE to. Another menu will expand.
-
4Select New Query Editor Window.
-
5Enter a name for the copied table. This should be something different than the original.
- If there are any columns you don't need in the duplicated version, remove them now.
-
6Select Execute. This creates a new table from the original table.
About This Article
1. Right-click Tables and select New Table.
2. Right-click the table and select Design.
3. Select columns and click Copy.
4. Go to the new table location and select the first row.
5. Paste the copied data and save the file.