Author |
Topic |
smily
Starting Member
25 Posts |
Posted - 2002-03-11 : 10:06:26
|
Hi Guys,Can anyone explain me...how to duplicate a table in enterprise manager?Smily |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-11 : 10:10:03
|
The easiest way would be to run the Import/Export DTS Wizard. It will walk you through the possible steps.It's actually easier to do this in query analyzer/T-SQL, using the SELECT...INTO syntax:SELECT * INTO Table2 FROM Table1This will copy the data, but it won't preserve indexes or constraints. It is also a performance hog if you have large tables. |
|
|
smily
Starting Member
25 Posts |
Posted - 2002-03-11 : 10:19:44
|
Quick response, but will copy only the data of the table,I need including the field namesIt is possible with q-analyzer?Pauline |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-11 : 10:23:33
|
Yes, everything about the table is copied except indexes and constraints. |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-03-11 : 10:23:40
|
smily , i think u r new to sql server.it first copy's the structure of the table and then copies the data.you cannot hold any data in a relational database without a field.When you exectute this , table2 will have the same schema (field's with same datatypes and name) with the dataSELECT * INTO Table2 FROM Table1HTH-------------------------------------------------------------- |
|
|
smily
Starting Member
25 Posts |
Posted - 2002-03-11 : 10:44:27
|
Yep, I can realize how thick I am? without thinking of that!!:)Yes I am a newbbie for SQL:)Thanks a lot guys!!!Smily |
|
|
smily
Starting Member
25 Posts |
Posted - 2002-03-11 : 11:22:31
|
quote: smily , i think u r new to sql server.it first copy's the structure of the table and then copies the data.you cannot hold any data in a relational database without a field.When you exectute this , table2 will have the same schema (field's with same datatypes and name) with the dataSELECT * INTO Table2 FROM Table1HTH--------------------------------------------------------------
Sorry it is not helping me!It gives some kine of ODBC weired error!Smily |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-03-11 : 11:32:45
|
You'll have to post your exact SQL statement and the EXACT error message. |
|
|
smily
Starting Member
25 Posts |
Posted - 2002-03-11 : 11:46:12
|
No Problem Robvolk,I created new tables with sql diagram.thanks for ur help!Smily |
|
|
|