Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.