Restore databse from .bak

Hi I am trying to restore a databse from a bak file taken from a different database using this script

RESTORE DATABASE coreRedHill
   FROM Disk = 'E:\CoreRedHill\CorePC 27-04-09.bak'
   WITH RECOVERY,
   MOVE 'corepc_Data' TO 'E:\CoreRedHill\coreRedHill.mdf',
   MOVE 'corepc_log' TO 'E:\CoreRedHill\coreRedHill_log.ldf'

GO

The database I want to restore is called coreRedHill that back up is taken from a database called corepc.

I am getting this error

The backup set holds a backup of a database other than the existing 'coreRedHill' database.


I have treid using Replace but no joy, can anyone tell me where I am going wrong please?
ac_davis2002Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
BryanMIConnect With a Mentor Commented:
Delete the coreRedHill database and then run your restore statement.  You don't need an existing DB to perform a restore operation.
0
 
ac_davis2002Author Commented:
Thanks for your help!!!!
0
 
ac_davis2002Author Commented:
first class
0
 
JohnBPriceCommented:
or use "WITH REPLACE" instead of "WITH RECOVERY".  Basically it's saying you can't RECOVER CoreRedHill from a different database but you can REPLACE it with a different database.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.