Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to restore over my default DB, like I have done many times before, but now I was getting told I cant restore because it's being used in this session. I though I'd take it offline and online again to make sure it wasn't being used. Something somewhere interuppted things.

Now I can't log in. I can log in to master, but still can't do anything in object explorer. What can I do?

share|improve this question

If you can log in to the Master database, try running the following query to change your login account's default database to Master (you can change back one you restore your default DB).

USE [master] GO ALTER LOGIN [loginname] WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english] GO

share|improve this answer
Luckily I managed to finally remember my 'sa' password and I could use that to change my windows user's default db. There is a more technical answer using the sqlcmd commandline app, which I will post later. Thanks though. – ProfK Sep 22 '10 at 10:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.