First, pay attention to points
1. URL
https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/connect-to-sql-server-when-system-administrators-are-locked-out?redirectedfrom=MSDN&view=sql- ver15-Server (official solution)
2.Windows no user is logged on in several states
(1) Windows login user is deleted
(2) Windows user login is disabled
Note: In this case, users do not know any sysadmin role, now I do not have a solution, to be resolved. . . .
3, add the -m parameter, will enter single-user mode
Solution two .Windows login user is deleted
1. Description of the problem
The case is windows authenticated user is deleted, sa password and forgotten, and no other user sysadmin role when solutions.
2. Solution
(1) Open the SQLServer Configuration Manager as an administrator
(2) Stop the agent service
(3) Open the properties of SQL services, modify the startup parameters, add the -m startup parameter
(4) open SSMS as Administrator
(5) After you log in, you can modify and add windows sa password authentication logon rights
(6) SQLServer services startup parameters to modify, delete -m parameter to restart the service
3. Notes
1. The agency should turn off the service, or will report the following error, meaning that after opening agency services, agency became the only connection