Solved

Duplicate table

Posted on 2011-09-07
3
187 Views
Last Modified: 2012-05-12
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
Comment
Question by:johnkainn
3 Comments
 
LVL 21

Accepted Solution

by:
JestersGrind earned 167 total points
ID: 36495641
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
 
LVL 5

Assisted Solution

by:zvytas
zvytas earned 166 total points
ID: 36495645
You can achieve the desired result by issuing the following SQL statement:

SELECT *
INTO NewTable1
FROM Table1
0
 
LVL 14

Assisted Solution

by:Christopher Gordon
Christopher Gordon earned 167 total points
ID: 36495786
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Dimension table indexes 8 26
Count with a subquery showing details 10 44
Webservices in T-SQL 3 31
MS SQL + Insert Into Table - If Doesnt Exist 9 35
This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question