Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Restore databse from .bak

Posted on 2009-05-12
4
Medium Priority
?
459 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

730 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