Solved

Restore SQL server 2005 database from mdf file

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

Expert Comment

by:Angelgeo
ID: 35196988
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now