Tuesday, April 3, 2012

Attached failed, Unable to open physical file, operating system error

Some time when you try to attach database files (.mdf, . ldf) to sql server , you might get the error
"Unable to open physical file, operating system error"


The reason behind this is that the account from which you are accessing the file , does not have rights for this specific folder or file.

Solution for this is that , you have to give the rights. In my case i have given the rights to the local administrator





After giving the rights , try to attach the file again.

I have attached the database successfully.





17 comments:

  1. thank you zafar.
    i was facing same but using urs post i resolved that issue

    jazakallah.
    Haseeb
    ashaseeb@hotmail.com

    ReplyDelete
  2. thanks, correct solution

    ReplyDelete
  3. saved me a lot of time. thanks

    ReplyDelete
  4. In Windows 7, Open SSMS with "Login As Administrator".
    You may not be able to see permissions tab.

    Pravin P

    ReplyDelete
  5. Rt, u dnt change the permissions, u change the user (to whom u give the permission) to Administrator... worked!
    Thanks...

    ReplyDelete
  6. If you have the admin rights to your system. you can actually run SSMS as an admin and this will solve the attachment problem.

    ReplyDelete
  7. Yup..thank you for your elightment...it's working..

    ReplyDelete
  8. Its worked.Good..

    ReplyDelete
  9. "Run as administrator"... that's the key. Thank you.

    ReplyDelete
  10. Thank you so much. We were able to solve the issue

    ReplyDelete
  11. Superb. Issue was resolved. Thank u very much

    ReplyDelete
  12. pocas veces entro a los blogs pero esta ves me sirvio de mucho gracias men ...

    ReplyDelete

Share This