Solved

Restore databse from .bak

Posted on 2009-05-12
4
456 Views
Last Modified: 2012-05-06
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?
0
Comment
Question by:ac_davis2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
BryanMI earned 500 total points
ID: 24366645
Delete the coreRedHill database and then run your restore statement.  You don't need an existing DB to perform a restore operation.
0
 

Author Comment

by:ac_davis2002
ID: 24366909
Thanks for your help!!!!
0
 

Author Closing Comment

by:ac_davis2002
ID: 31580611
first class
0
 
LVL 16

Expert Comment

by:JohnBPrice
ID: 24367270
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

Featured Post

Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question