views:

962

answers:

2

This is rather embarrassing, but I accidentally deleted my Windows account from the list of SQL Server 2008 users and I cannot for the life of me figure out how to re-add myself now that I don't have login privileges.

The server is running on my machine and the only other Windows users with access are IUSR, NETWORK SERVICE and SYSTEM. Is there anything I can do short of re-installing?

A: 

Is there not an option to re-claim ownership if you are an administrator on the machine that its running from using the properties?

Andi
I'm not even able to login into SSMS :/
Nathan Taylor
Can you not logon using a local admin account? I would of thought it would let you open the server app at least?
Andi
It was the local admin account that I deleted. However, I found a solution!
Nathan Taylor
I'm interested in what it was and sorry I couldn't help more!
Andi
+2  A: 

Luckily, this wasn't too hard to fix (not that it should have been hard...)!

This blog post explains the steps for starting SQL Server in Single User Mode, which (for some reason) allowed me to login as my Windows administrator account, add the account to the user list (with CREATE LOGIN), enable the SA user and set its password to something I actually knew, and finally login as SA and give the Windows account sysadmin privileges.

Nathan Taylor
This link is out of date!
@user287745 What do you mean? It still works for me.
Nathan Taylor