I cannot enable sa account
Asked Answered
R

4

10

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?

Rachellrachelle answered 1/8, 2013 at 10:25 Comment(0)
S
13

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

Sawdust answered 1/8, 2013 at 10:29 Comment(0)
E
14

login with windows authentication and select server properties and go to security tab check the bubble SQL server and windows authentication click ok.

or

run below query

ALTER LOGIN [sa] WITH PASSWORD='AnyStronG@#Passw)e', CHECK_POLICY=OFF
GO
ALTER LOGIN [sa] ENABLE
GO

Ref:- Enable Sa Login

Eritrea answered 28/9, 2015 at 5:35 Comment(1)
Archive link: web.archive.org/web/20161005170441/http://…Olio
S
13

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

Sawdust answered 1/8, 2013 at 10:29 Comment(0)
M
10
  1. Launch SQL Server Configuration Manager (as local machine Administrator)
  2. Select SQL Server Services -> SQL Server Service on the right side
  3. Right-Click on it -> Properties -> Advanced Tab
  4. Into "Startup Parameters" string add ';-m' to the end of string -> This will bring SQL server to 'single user mode' in which local machine Admins have super-user rights.
  5. Restart service in order Startup Parameters to take effect.
  6. Login via SQL Server Management Studio using Windows Authentication as local machine Administrator -> now it has super-user preferences and allows you to change everything.
Moralist answered 7/3, 2016 at 12:18 Comment(0)
A
2

Check if both Windows and mixed authentication is enabled on the server properties > Security

.enter image description here

Android answered 17/2, 2022 at 7:2 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewCantilever

© 2022 - 2024 — McMap. All rights reserved.