How to Clone tables? [Resolved]

Posted by Rajujrk under Sql Server on 2/26/2010 | Views : 1595 | Status : [Member] | Replies : 4
Hai

is any query to clone the table with different name in SQL server?

Thanks & Regards

Rajkumar J



Responses

Posted by: Vuyiswamb on: 2/26/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down

Resolved
use a Select into statement

select * into Table2 from Table1 



it will take all the columns and data into the table2 with all columns the same but not the constraints.

is this what you want ?

Thank you for posting at Dotnetfunda
[Administrator]

Rajujrk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajujrk on: 2/26/2010 [Member] Starter

Up
0
Down
Ya Exactly...

I tried and worked well..



Thanks & Regards

Rajkumar J

Rajujrk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 2/26/2010 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Thank you for Posting at Dotnetfunda

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Rajujrk, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeraaj.Sharma on: 6/28/2013 [Member] Starter | Points: 25

Up
0
Down
just to add with the answer
into does`t copy any trigger , index , constraint.



Rajujrk, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response