Alex Alex - 6 months ago 15
SQL Question

Duplicating a TABLE using Microsoft SQL Server Mangement

Need to duplicate a TABLE using

Microsoft SQL Management Studio 2008


The TABLE needs to duplicate all table row (Primary Key) ID as well.

Thanks.

Answer

I assume that my sql tag is wrong

in SSMS open a new query window and then do something like

SELECT * INTO NewTable
FROM OldTable

change NewTable to the name that the new table should have, change OldTable to the name of the current table

this will copy over the basic table structure and all the data...it will NOT do any of the constraints, you need to script those out and change the names in those scripts