Recover SQL account

Posted on 2011-03-03
Last Modified: 2012-06-27

I have changed (wrongly) a few permissions in the SQL Server Express account. Now I have "sa" account disable, the windows authentication without any permission to change things.

It's all in my local machine, where I have Visual Studio 2008 and 2010, but now I cannot do anything :(

Can I do something or do I need to install everything? If I need to install what I really need to reinstall (since it was installed with Visual Studio)?

Jorge Paulino
Question by:jpaulino
  • 2
  • 2
LVL 15

Accepted Solution

derekkromm earned 500 total points
ID: 35033164
There's a workaround. If you're an administrator, you can do the following:

- start sql server in single-user mode (
- in single-user mode, windows administrators are (should be...) given access to the database, regardless of how authentication is setup
- now, you can use the sqlcmd utility ( to add yourself to the sysadmin roles (sp_addsrvrolemember, etc.)
LVL 15

Expert Comment

ID: 35033166

Expert Comment

ID: 35036980
Can't you just re-enable the SA user, if you login with the machine administrator, I think you will be able to do this.
LVL 48

Author Comment

ID: 35044508
Well, the problem is that I'm not the administrator (I remove that from my account before I disable the sa user). That way I cannot do that.

I'm reinstalling again the SQL Server ... I hope it works after that!
LVL 48

Author Closing Comment

ID: 35074741
I have installed SQL Server 2008 R2 and it's working.

Thanks for your time!

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question