Sql-server – restoring SQL Server from backup into a database with different database name

sql serverssms

I have been provided SQL Server backups to restore but they have to be restored into new databases with different names on same server.

To explain it, say I have database "MyDB" and its backup "MyDB_full.bac" has been provided. I want to restore it into "MyDB_new".

What I have tried ?

I have tried to restore it in SSMS but was unsuccessful, since I m getting error message :

the backup set holds a backup of a database other than the existing

Kindly note I don't want to lose basic database "MyDB".

Best Answer

I found this link to be particularly helpful. I'll summarize below: you are probably trying to restore the database on another existing active database. You can run the following query (albeit with your details filled in) to restore your database:


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