Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Restore SQL server 2005 database from mdf file

Posted on 2011-03-23
5
Medium Priority
?
730 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 2000 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
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…
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: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

722 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