Friday, February 17, 2012

Copy Table

How can I make a copy of an existing table ?
ThanksHi,
You can use the command SELECT * INTO new_table from old_table.
This above command will copy the table structure and data into a new table ,
but you need
to recreate all the constraints and indexes manually into the new table
1. Copy Customer table to cust_backup with data
select * into cust_back from cutomer
2. Copy only the structure of customer table to cust_back
select * into cust_back from cutomer where 1 = 2
Thanks
Hari
MCDBA
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:2c2aa01c46950$b2902db0$a501280a@.phx.gbl...
> How can I make a copy of an existing table ?
> Thanks

No comments:

Post a Comment