As a DBA, it is perfectly normal to forget your password from time to time. No need to hold your breath or panic. In case of emergency that you need to recall your password or the ‘sa’ password, no need to panic because you can do it via the backdoor any way. These steps should get you going and move on with your administration tasks.
- From the SQL Server configuration manager, stop the SQL services.
- Open a cmd window as an administrator or elevated rights
- From the command prompt, you need to locate the folder path of where your SQL Server binary files are located. Go to that path and type; sqlservr.exe –m.
- Once the SQL server service succesfully starts with single user, open another cmd window as administrator or account with elevated rights
- Type in command prompt; sqlcmd –S <servername> or (local) if your SQL Server is in the same machine.
- Then you can reset the ‘sa’ password and also enable or unlock it at the same time.
ALTER LOGIN [sa] WITH PASSWORD=N’P@ssword’
ALTER LOGIN [sa] ENABLE
There you have it. You have successfully taken control of the ‘sa’ account. From this point, close all the previous command windows and go back to SQL Configuration Manager. Start the SQL Server services. Try to connect to your SQL Server and start to use ‘sa’ account. 🙂