Change Login's Default Database in SQL Server
If you have ever dropped a database and found yourself not able to login because your default database no longer exists you know it can be quite annoying. You can still connect through query analyzer by connecting to a different database, but you won't be able to do anything through the object explorer as it always defaults to your default database. The sql below will solve your problems.
alter login MyLogin
with default_database = master
If you need to alter a login that is using windows authentication use the following code. The only difference is you just have to specify the domain and the directory login and put it in brackets.
alter login [MyDomain\MyLogin]
with default_database = master
I hope this helps and if not at least I will be able to easily find the solution next time I run into it.