I detached my database and when I tried to reattach my database I got error 4064. how do I fix this?
asked Jan 01, 2010 at 08:38 AM in Default
The problem is caused because you have detached database which was your default database.
And if you try to login from SSMS to the server by default it tries to connect you to your default database which doesn't exists currently.
If connecting from SSMS, click on the Advanced button and change the Connecto to database from "< default >" to "tempdb" or "master". Then connect to server.
if after this you will be able to attach the database, then evertyhing should be ok. if not, try to modify the default database for your login:
Instead master, you can specify any existing database on the server.