Solved

Restore SQL server 2005 database from mdf file

Posted on 2011-03-23
5
719 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

729 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