General
Permissions
- Local administrator password for the SQL Server.
- Access to the server's console.
Solution Steps
- Start the SQL Server in SINGLE_USER mode (from command line or from the configuration manager).
- Open CMD using administrator's account.
- (optional) Create a new account.
- Assign the designated account the sysadmin server role.
- (optional) Reset the SA password.
- Return the server to MULTI_USER mode.
Detailed steps
Single User Mode
- Open the "SQL Configuration Manager Console".
- Navigate to "SQL Server Services"
- Right click on the specific instance and choose properties.
- Navigate to "Advanced" tab to the "Startup parameters" attribute.
- Add "-m;" before the existing string.
- Restart the SQL Server.
- Verify that no other user is trying to connect because in SINGLE_USER only a single user can connect at a time.
SQL Command Line
Using the Administrator account run from CMD
|
sqlcmd –S <host\instance> |
Create New Account
|
Create LOGIN '<username>' WITH PASSWORD '<password>' |
Assign sysadmin
|
SP_ADDSRVROLEMEMBER '<username>','sysadmin' |