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

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Copying a database.

Author  Topic 

Codesensitive
Starting Member

11 Posts

Posted - 2002-05-07 : 10:37:56
Hi, how do I make a copy of a database so it's identical to the original but has a different name?

Thanks

Nazim
A custom title

1408 Posts

Posted - 2002-05-07 : 10:42:30
Did you visit the homepage?

Did you read Mark's new Article on Upgrade .

if you had read it , you could have answered your question urself.

read it http://www.sqlteam.com/item.asp?ItemID=9066 .



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

Codesensitive
Starting Member

11 Posts

Posted - 2002-05-07 : 10:47:13
Thank you!

Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2002-05-07 : 10:49:30
Use the Copy Database Wizard

OR
1. Backup the original database to device
sp_addumpdevice 'disk','OriginalDatabaseDumpDevice', 'c:\dump\Db.bak'
BACKUP DATABASE OriginalDB TO OriginalDatabaseDumpDevice

2. Restore the files
RESTORE DATABASE <New Database Name goes here>
FROM OriginalDatabaseDumpDevice
WITH RECOVERY,
MOVE 'oldData' TO 'c:\Data\New_data.mdf' ,
MOVE 'oldLog' TO 'c:\New_log.ldf'

To view the number and names of the files in the backup use
RESTORE FILELISTONLY FROM OriginalDatabaseDumpDevice

I've never used the Copy Database Wizard. I'd say backup and restore is the standard way to copy a database.
Go to Top of Page
   

- Advertisement -