• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Duplicate table

I need to create a duplicate of a table I already have.
How do I do that? Do I need to create first a new table or can that be done automatically?
0
johnkainn
Asked:
johnkainn
3 Solutions
 
JestersGrindCommented:
In Object Explorer, right-click on the table and select Script Table as --> CREATE To --> New Query Editor window.  Then edit the script to change the table names.  Run the script.

Greg
0
 
zvytasCommented:
You can achieve the desired result by issuing the following SQL statement:

SELECT *
INTO NewTable1
FROM Table1
0
 
Christopher GordonSenior Developer AnalystCommented:
I usually use the Import / Export wizard (right click on database in Management Studio).  This will create the destination table and populate with data.  It will not move indexes/constraints.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now