Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Tables (and Data) from one Database to a new one

Status
Not open for further replies.

nzgirl

Programmer
Feb 26, 2003
72
NZ
Hi.
I'm using SQL Server 7 and need to copy the contents of one database to another. (I'll rename a couple of the tables afterwards).
Is there a good way to do this?
I don't even know what to search under (though I have tried!)
Enterprise Manager gives you a copy option.. though ?? knows what it actually does (there doesn't seem to be a paste option....)

Thanks
:)
 
Have a look at DTS.
To use the wizard right click the source database
Select All Tasks / Export Data
Then follow the wizard.

You will come to screen where you can select copy data and objects between sql server databases - choose this one.

This is for sql2000 but Im pretty sure sql70 is the same.

Hope this help you
 
Personally if you can detach the database for a few minutes, I prefer to detach and then use the regular Windows copy and paste to copy the database file. The reattch the orginal database and attach the new one. You should make sure your logins exist onthe new server before you do this or you will end up with orphaned users.

If you can't take down a production database, then use backup and restore.
 
Ok... I got it wrong. Apparently it was a copy and rename within the database, and that was easy with the import data function!
SQL sister I would have used backup and restore if it was between databases...
Thanks
:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top