Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to create a copy of a SQL Server 2008 database under a new name on the same server.

I have physical access to the machine. I have tried to create a full backup and then restore that backup under a new name and I get an error from SSMS that "The backup set holds a backup for a database other than the selected database."

I have also tried doing a restore from database rather than restore from file and that did not work either.

What is the best way of making a full backup of a database and restoring the database with a new name?

share|improve this question

2 Answers 2

When making that full backup, select to "Overwrite" your old backup or save it under a different name altogether.

Or you can use T-SQL:

RESTORE DATABASE YourDatabase FROM DISK = 'C:\YourDatabase.bak' WITH REPLACE

share|improve this answer
up vote 0 down vote accepted

Doh! The name of the database that you intend the copy to be must not exist.

I got it to work now [facepalm]

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.