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 installed a SQL Server 2008 on a machine and created a database on it. Subsequently, the machine that this was installed on was added to a Windows domain and it appears the original local user account that Server Server was install on was renamed or deleted. Now, I'm unable to connect to the database using a domain administrator, newly created local administrator account, or the local system account. When I attempt to expand the database in SQL Server Management Studio I get the error "The database is not accessible. (Object Explorer)". Is there any way I can get access to the database? I want to somehow just make a copy of the .mdf file and recreate it in Management Studio and then just overwrite the newly created one with the copy but I suspect this will maintain the permission issues that I have now. Any ideas are welcome.

share|improve this question
So you can connect to the SQL instance, but can't get into a specific database? – squillman Feb 24 '11 at 21:34
Correct. When I try to expand the one database that I have I get the error I mentioned. – Josh Feb 24 '11 at 22:01
up vote 0 down vote accepted

Log into Windows with the old username, but prefix it with the computer's name.

For example:


If that doesn't work, let us know and we can help with the next step.

If you can connect to the SQL instance, can you do so as Administrator? If so, all you have to do is change the owner of the DB. Right-click on the database, go to Properties, then Files, and change the owner there.

share|improve this answer
Thanks but the old user may have been deleted. I'm still investigating whether it was just renamed or deleted altogether. I assume if it was just renamed I should be to login as the renamed user and everything should work but if the user was deleted is there anything that I can do? – Josh Feb 24 '11 at 22:03
Also, is there a way I can double-check which Windows user account currently owns the database? – Josh Feb 24 '11 at 22:03
Check my updated answer. – user3914 Feb 24 '11 at 22:05
Joining a domain doesn't rename or delete local user accounts. – joeqwerty Feb 24 '11 at 22:11
@joeqwerty - it may have been done as a part of IT policy. – user3914 Feb 24 '11 at 22:13

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.