Solved

Restore SQL server 2005 database from mdf file

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
What is the best way to calculate hours worked 5 71
Stored procedure 4 32
Divide by zero error encountered. 2 40
Delete from table 6 47
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…
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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