Our developer left and no one knew the sa password for SQL server on his development machine.
Reset the sa password.
Run SQL in Single User Mode
- Open SQL Server Configuration Manager -> SQL Server Services.
- Right click on your SQL instance and Stop it.
- Right click again on your SQL instance -> Properties -> Advance
- Under Startup Parameters, add -m; before -dc
- Click OK
- Go to SQL Server Network Configuration -> Protocols for <SQL Instance>
- Right click Named Pipes, ensure that it is enabled.
- Under Pipe Name: Change it to \\.\pipe\sql\query
- Start your SQL Instance.
Create a Recovery Account with SysAdmin rights
- Open an Elevated Command Prompt
- Type: sqlcmd
- You should get the prompt, ‘1>’
- Type in the following commands in sequence:
CREATE LOGIN recoverpwd WITH PASSWORD = ‘MyPassword1’
exec sp_addsrvrolemember ‘recoverpwd’, ‘sysadmin’
Login as recoverypwd and reset your sa password.