Go Premium for a chance to win a PS4. Enter to Win


Recover SQL account

Posted on 2011-03-03
Medium Priority
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 1500 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 (http://msdn.microsoft.com/en-us/library/ms188236.aspx)
- 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 (http://msdn.microsoft.com/en-us/library/ms165702.aspx) 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

971 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