Microsoft SQL Server says my login is disabled, even in single user/DAC mode I'm locked out of a local database, and the single-user mode option that has worked for me in the past isn't working for me here. I could use some options to try.

It's saying the account is disabled, which I didn't think was even possible for single-user mode.

What I've tried already:

Restarting in single-user mode:

C:\Program Files\Microsoft SQL Server\MSSQL10_50.DBNAME\MSSQL\Binn&gt;net stop MSSQL$DBNAME
The SQL Server (DBNAME) service is stopping..
The SQL Server (DBNAME) service was stopped successfully.


C:\Program Files\Microsoft SQL Server\MSSQL10_50.DBNAME\MSSQL\Binn&gt;.\sqlservr -sDBNAME -m -c

[seems to come up]


The login attempt looks like this:

C:\Program Files\Microsoft SQL Server\MSSQL10_50.DBNAME\MSSQL\Binn&gt;sqlcmd -S .\DBNAME
Msg 18470, Level 14, State 1, Server MY-PC\DBNAME, Line 1
Login failed for user 'My-PC\sarahg'. Reason: The account is disabled.


Server output:

2012-05-29 15:55:25.11 Logon       Error: 18470, Severity: 14, State: 1.
2012-05-29 15:55:25.11 Logon       Login failed for user 'My-PC\sarahg'. Reason: The account is disabled. [CLIENT: &lt;local machine&gt;]


Restarting in DAC mode:

C:\Program Files\Microsoft SQL Server\MSSQL10_50.DBNAME\MSSQL\Binn&gt;.\sqlservr -sDBNAME -m -c -t 7806
... blah blah ...
2012-05-29 15:59:05.59 spid6s      Server name is 'MY-PC\DBNAME'. This is an informational message only. No user action is required.
2012-05-29 15:59:05.60 spid9s      Starting up database 'model'.
2012-05-29 15:59:05.60 spid6s      Informational: No full-text supported languages found.
2012-05-29 15:59:05.60 spid6s      Starting up database 'msdb'.
2012-05-29 15:59:05.72 Server      A self-generated certificate was successfully loaded for encryption.
2012-05-29 15:59:05.72 Server      Server is listening on [ 'any' &lt;ipv6&gt; 49201].
2012-05-29 15:59:05.74 Server      Server is listening on [ 'any' &lt;ipv4&gt; 49201].
2012-05-29 15:59:05.74 Server      Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\DBNAME ].
2012-05-29 15:59:05.74 Server      Server named pipe provider is ready to accept connection on [ \\.\pipe\MSSQL$DBNAME\sql\query ].


The login attempt looks like this:

C:\Program Files\Microsoft SQL Server\MSSQL10_50.DBNAME\MSSQL\Binn&gt;sqlcmd -A -S .\DBNAME
Msg 18470, Level 14, State 1, Server MY-PC\DBNAME, Line 1
Login failed for user 'Mys-PC\sarahg'. Reason: The account is disabled.


With server log:

2012-05-29 16:00:24.86 Logon       Error: 18470, Severity: 14, State: 1.
2012-05-29 16:00:24.86 Logon       Login failed for user 'Mys-PC\sarahg'. Reason: The account is disabled. [CLIENT: 127.0.0.1]


Any help is very welcome,

-- Sarah
I have had the exact same problem and tried this solution and it works: Using PSExec (a free download from Microsoft) to connect to an instance using the NT AUTHORITY\SYSTEM account. Sample syntax:

PsExec -s -i "C:\...\Tools\Binn\ManagementStudio\Ssms.exe"


This will launch Management Studio as a Windows account that has native sysadmin permissions, and this will allow you to switch to mixed mode, enable the sa account, reset the sa account, add your own Windows account as an administrator, etc.

A lot more information can be found in the following article:

http://www.mssqltips.com/sqlservertip/2682/recover-access-to-a-sql-server-instance/

However bear in mind that you may be breaking some contract, just wanted to note it. :)