SSMS not showing Attach Database/Locate Database Files Dialog DIR Tree.

Shane P. Watson 0 Reputation points
2025-05-07T12:34:09.6366667+00:00

I am unable to Attach a Database in SSMS. The Locate Database Files Dialog text is frozen on a USB port folder that no longer exists. Even entering a dummy database file *.mdf, the OK button does not enable. When I tried to repair SSMS, Error message; (0x80070002) I could uninstall/reinstall, but would rather know what went wrong to prevent it happening again. Thank you.

Answer: I just pasted the filename and fullpath into the Filename text box, attached it, then exited and reopened and the tree was there.

SQL Server Database Engine
{count} votes

1 answer

Sort by: Most helpful
  1. Lakshmi Narayana Garikapati 640 Reputation points Microsoft External Staff Moderator
    2025-12-01T12:17:45.01+00:00

    Hi @Shane P. Watson,

    It looks like SSMS cached the last folder path you used in the Locate Database Files dialog, and since that path pointed to a USB drive that no longer exists, the dialog froze and the OK button stayed disabled. That’s why even a dummy .mdf filename wouldn’t enable it.

    What worked for me was pasting the full file path (e.g. C:\SQLData\MyDB.mdf) directly into the filename box. SSMS then attached the database successfully, and after restarting SSMS the tree refreshed correctly.

    If this happens again, you can reset SSMS’s cached UI state by closing SSMS and deleting the SqlStudio.bin file under:

    %AppData%\Microsoft\SQL Server Management Studio<version>\

    Restart SSMS and the dialog will rebuild with default settings.

    Thanks,

    Lakshmi


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.