September 30, 2012 at 4:32 pm
Hello,
I have a database file (mdf) and it's log file on a portable hard drive. My computer's hard drive crashed today. Due to the crash, I am trying to access the database files using my other computer.
How do I create a database on my new machine using the existing database and log files?
I was not able to backup the data before the disk crash, thus I only have the MDF and LOG files without any backup file.
Please help.
Thanks
Rohan
October 1, 2012 at 1:21 am
If you have SQL Server running on your other pc, attach your harddrive to that PC and then attach the database files as normal to you pc's sql server instance.
October 1, 2012 at 6:17 am
Hello,
Thank you for your response, I tried the "Attach" method but I got the below error:
"CREATE FILE encountered operating system error 5 (Access is denied) while attempting to open"
Can you please suggest how do I access these files?
Thanks
October 1, 2012 at 6:32 am
Ah yes, if you are the admin on the computer your using, you will need to update the permissions on the database files via windows explorer > right clicking on one of the db files and selecting the permissions option.
Navigate to the security tab and update the permissions to allow everyone access, do this for both db files, then try to reattach
October 1, 2012 at 7:11 am
Thank you so much for your help. I logged in as SA and attached the files. Then I logged out and logged back in as user and everything works well.
This issue is now resolved.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply