I have only .MDF file. How can I use this .MDF file and access the data now ?

Posted by Jasminej under Sql Server on 7/13/2012 | Points: 10 | Views : 1755 | Status : [Member] | Replies : 2
hi experts!

I have only .MDF file. But, I missed out the .LDF file

How can I use this .MDF file and access the data now ?




Responses

Posted by: Pandians on: 7/13/2012 [Member] [MVP] Silver | Points: 25

Up
0
Down
Here is the solution!

Let's have the following scenario!

1. I have only .MDF file in (D:\PandianDB.mdf)
2. I want to access the objects/data from this .MDF file!
USE MASTER 

GO
CREATE DATABASE PandianDB
ON PRIMARY (NAME = N'PandianDB',
FILENAME = N'D:\PandianDB.mdf',
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB )
FOR ATTACH_REBUILD_LOG
GO
Log file automatically will be created!
Now, you have a database named "PandianDB" and access the objects/data!

Cheers
www.SQLServerbuddy.blogspot.com
iLink Multitech Solutions

Jasminej, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sumit.Bundiwal on: 7/13/2012 [Member] Starter | Points: 25

Up
0
Down
http://stackoverflow.com/questions/773059/how-to-recover-database-from-mdf-in-sql-server-2005

sumit bundiwal

Jasminej, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response