Solved

Restore SQL server 2005 database from mdf file

Posted on 2011-03-23
5
722 Views
Last Modified: 2012-05-11
Hi,

I tried to restore a sql server database using the .bak file and received an error looking for a .MDF file.

Any help on how to do a restore would be great. Its a full backup and i need to restore / create a new database from it.

Regards,

Ross
0
Comment
Question by:ross13
[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
5 Comments
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 35196944
Hi,

can you share your error screen shot....


- Bhavesh
0
 
LVL 9

Expert Comment

by:Roman Gherman
ID: 35196983
Hi,

Right Click on Databases -> Restore DataBase -> write a DB name there -> SELECT THE FROM DEVICE radio button -> select backup -> tick the Restore checkbox -> OK
DBRESTORE.png
0
 
LVL 1

Expert Comment

by:Muralidharand
ID: 35197035
Did you checked the Restore As path .... is it a valid path ?
0
 
LVL 1

Accepted Solution

by:
veasnamuch earned 500 total points
ID: 35197271
I think you need to change its file name and path. Because with default setting of restore mechanism, still used its old file .mdf and .ldf  name for the source db of backup, so you should change it to the  the new one.

Suppose your old database before backup is SAMPLE, and its path would be at C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data. Consider that you mdf file is SAMPLE.MDF and SAMPLE_Log.ldf

When you back up it, as SAMPLE_BACKUP.BAK, and when you restore if you click on Options
you will see the bellow setting are present at the column Restore As, that's where you need to change otherwhise it will not work because it's still in use by your previous database file SAMPLE

 location to change the path and file name
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

630 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