Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Duplicate table
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

smily
Starting Member

25 Posts

Posted - 03/11/2002 :  10:06:26  Show Profile
Hi Guys,

Can anyone explain me...how to duplicate a table in enterprise manager?

Smily

robvolk
Most Valuable Yak

USA
15732 Posts

Posted - 03/11/2002 :  10:10:03  Show Profile  Visit robvolk's Homepage
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 Table1

This will copy the data, but it won't preserve indexes or constraints. It is also a performance hog if you have large tables.

Go to Top of Page

smily
Starting Member

25 Posts

Posted - 03/11/2002 :  10:19:44  Show Profile
Quick response, but will copy only the data of the table,
I need including the field names

It is possible with q-analyzer?

Pauline

Go to Top of Page

robvolk
Most Valuable Yak

USA
15732 Posts

Posted - 03/11/2002 :  10:23:33  Show Profile  Visit robvolk's Homepage
Yes, everything about the table is copied except indexes and constraints.

Go to Top of Page

Nazim
A custom title

United Arab Emirates
1408 Posts

Posted - 03/11/2002 :  10:23:40  Show Profile
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 data

SELECT * INTO Table2 FROM Table1

HTH

--------------------------------------------------------------
Go to Top of Page

smily
Starting Member

25 Posts

Posted - 03/11/2002 :  10:44:27  Show Profile
Yep, I can realize how thick I am? without thinking of that!!:)

Yes I am a newbbie for SQL:)


Thanks a lot guys!!!

Smily




Go to Top of Page

smily
Starting Member

25 Posts

Posted - 03/11/2002 :  11:22:31  Show Profile
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 data

SELECT * INTO Table2 FROM Table1

HTH

--------------------------------------------------------------





Sorry it is not helping me!

It gives some kine of ODBC weired error!

Smily

Go to Top of Page

robvolk
Most Valuable Yak

USA
15732 Posts

Posted - 03/11/2002 :  11:32:45  Show Profile  Visit robvolk's Homepage
You'll have to post your exact SQL statement and the EXACT error message.

Go to Top of Page

smily
Starting Member

25 Posts

Posted - 03/11/2002 :  11:46:12  Show Profile
No Problem Robvolk,

I created new tables with sql diagram.

thanks for ur help!

Smily

Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000