locked
Database gone after click detach RRS feed

  • Question

  • Hello, i got a question here.. really need a feedback on this..

    i try to detach my database and it works.. but when i detach it, the database is gone.. my question is how to attach the database back since i cannot see the database anymore..

    thanks


    kneeah
    Wednesday, July 6, 2011 2:55 AM

Answers

  • Hi,

    Right click databases folder and click attach, then point it to the mdf in the file system.

    Alternativly use CREATE DATABASE <Name> FOR ATTACH as detailed in this link

    http://msdn.microsoft.com/en-us/library/ms176061.aspx

    Do not use sp_attach_db, because it is deprecated.

    Hope this helps.

     


    Peter Carter http://sqlserverdownanddirty.blogspot.com/
    • Marked as answer by kneeah Thursday, July 7, 2011 1:03 AM
    Wednesday, July 6, 2011 7:50 AM

All replies

  • Hi,

    Right click databases folder and click attach, then point it to the mdf in the file system.

    Alternativly use CREATE DATABASE <Name> FOR ATTACH as detailed in this link

    http://msdn.microsoft.com/en-us/library/ms176061.aspx

    Do not use sp_attach_db, because it is deprecated.

    Hope this helps.

     


    Peter Carter http://sqlserverdownanddirty.blogspot.com/
    • Marked as answer by kneeah Thursday, July 7, 2011 1:03 AM
    Wednesday, July 6, 2011 7:50 AM
  • Yes , I agreed with above answer.


    Kuldeep
    Wednesday, July 6, 2011 12:17 PM
  • Big thanks :)
    kneeah
    Thursday, July 7, 2011 1:03 AM