Search code examples
sqlsql-servert-sqlsql-server-2008-r2account

I cannot enable sa account


I dont have users in sysadmin except [sa] user

unfortunately, I logged in as [sa] user and disabled it

then I cant enable it, what I can do to enable it again?


Solution

  • You'll have to use sqlcmd.exe with Windows Authentication (Specify the -E flag) and renable the account:

    Open up command prompt and navigate to the SQL Directory and use sqlcmd.exe -S server -E

    USE [YourDatabase]
    GO
    
    ALTER LOGIN [sa] ENABLE
    GO
    

    http://msdn.microsoft.com/en-us/library/ms162773.aspx