Thursday, November 6, 2008

Copying Tables

To create a copy of a table, you can use SELECT INTO to extract all the rows from an existing table into a new table. The new table must not exist already.

The following example will copy all the rows from Address table to a new table called TempAddress

Use AdventureWorks
Go
Select * into TempAddress from Person.Address

This statement does not copy the indexes, constraints,triggers, Keys etc. to the new table

No comments: