Home » sql server » How to Reset Password in SQL Server with Command Line & Other Way

How to Reset Password in SQL Server with Command Line & Other Way

Published By Ashwani Tiwari
Aswin Vijayan
Approved By Aswin Vijayan
Published On September 7th, 2023
Reading Time 7 Minutes Reading
Category sql server, Tips, Updates

how to reset password sql server

Summary: It’s not different to forget a password & in fact we all have faced it at least once. This is why this article talks about how to reset password SQL Server database. SQL Server is relational database management developed by Microsoft. It makes use of two files in order to store its database – MDF and NDF, of which MDF is the Main Database File and LDF is the secondary file. Since MDF is the main or primary file for storing SQL server data, when it comes to securing the SQL server database, passwords are imposed on the MDF file.

How to Find the Password for SQL Server with SQL Password Reset Command Method

Before we start learning about how to reset password in SQL command line or any other method, it’s important to know a lot of backstories.

Imposing passwords is the most common and traditional way of securing a particular database. In SQL server a default user is created for managing the entire database. This default user is known as SQL Administrator referred to as SA in short. When the entire SQL Server database needs to be secured, the SA imposes a password on the MDF file.

A large number of users can be added by the SA when it comes to the deployment of SQL Server in a big organization. Each user will have a different username with an individual unique password.

How to Reset Password SQL Server

At times, a user might forget his SQL database password. Once the password is forgotten, the SQL database gets inaccessible. However, the good news is that the password can be easily reset with the help of the SA. Since the SA has access to the entire database, changing the password of the database is very simple. To reset the SQL server password, the following steps need to be followed in Microsoft SQL Server 2014:

1. Click on Start

2. Click on All Programs and then select Microsoft SQL Server [version].

3. Click on SQL Server Configuration Manager.


4. Select the SQL Server Services option from the menu.

Remove SQL Database Password

5. Select SQL Service Agent and click on the Properties option from the drop-down menu.

Reset SQL Server Password

6. In the Log On tab, for the account listed, type the new password in the Password and Confirm Password dialogue boxes.

Remove SQL Database Password

The password will be set without the requirement of restarting the server.

How to Reset SQL Server Password in SQL Server 2016?

1. In the Start text bar, type the following text to open SQL Server Configuration Manager.

  • For Windows 10, type ‘sqlservermanager13.msc’ and hit the Enter Key.
  • For Windows 8, type ‘sqlservermanager13.msc’ and press Enter. 

2. Go to SQL Server Agent Option as shown in the screenshot.

right-click on SQL Server Agent

3. Afterward, right-click on SQL Server Agent and click on Properties.

4. Under the SQL Server Agent (SQLEXPRESS) Properties window, select the radio button corresponding to This Account. 

Click on The Account

5. A pop-up window appears on the screen, enter the Account details and reset the SQL Password.

Password Recovery When SA Is Inaccessible

We know that this SQL password reset command do not work always. The password reset process takes a different turn in the absence of SQL Administrators. There can be instances when the SA might not be available. In such a scenario, manual recovery or removal of SQL passwords is out of the question. Therefore, in such cases, the best solution is to take help of third-party applications like SQL Password Recovery Tool.

Reset SQL Server Password with Smart Utility

The SQL Server SA Password Recovery is an effectual utility designed for the sole purpose of removing and resetting the SQL file password. The software is capable enough to reset both SA and User passwords from the SQL MDF file. For performing the password recovery process, there is no need for an SQL Server. In addition to this, if you have Microsoft SQL Server, the SQL Services should be stopped at the time when the MDF file is loaded in the software.

To reset the SQL database password with the software, follow the below-mentioned steps:

1. Download SQL Database Password Recovery and run the software.

Download Now Purchase Now

2. Click on the Browse option to add the MDF file.

This image has an empty alt attribute; its file name is 7-1.png

3. Time to select the login name whose password you want to reset and set a new password.

This image has an empty alt attribute; its file name is 8-1.png

4. At last, click on Reset Password to reset SQL Server SA & User Password.

This image has an empty alt attribute; its file name is 9-2.png

Also Read: Fix Missing Indexes in SQL Server Database

Learn SQL Password Reset Command Method

This manual method is capable of resetting the SA password in your new SQL account but indeed it’s a risky one. There are several drawbacks present here that we will discuss later:

First of all, just launch the command prompt & simply execute these commands:

ALTER LOGIN sa WITH PASSWORD = 'new_password';

Enter this command and then easily fix the issues even if you have forgot password SQL Server database.

There is an alternate command process as well. Let’s have a look at that:

sp_password @new = 'newpassword', @loginame = 'sa'

Both commands are capable of providing users the ability to reset passwords.

These commands do not provide users with surety that their password will be reset or not as several users reported that it failed.

Drawbacks of this CMD Method to Reset Password SQL Server

The manual methods are full of risks & users are not aware of them. Therefore, below we are mentioning these drawbacks below:

Time-Consuming: The command line method is indeed very time-consuming & reduces users’ efficiency. This makes users less productive for other core operations.

Complex Process: The procedure is quite complex & there is a high chance that it can make even experienced users confuse during the execution.

Lack of Features: Learning how to reset password in SQL command line is not effective as there are no advanced features present. This makes it even more tough for users to reset their password.

Expert Assistance or Proficient Technicalities: The SQL server database is itself a technical subject. Moreover, executing such a task without any knowledge of in-depth technicalities can trouble users.No Surety of Results: It’s a 50-50 chance that users will be able to reset their password in SQL sever using these techniques. Hence, users can and should not rely on these completely.


Removal of SQL database passwords is impossible to reset in case the administrator is unavailable or in a worst-case scenario, the password of the SA database is not known. Evidently, in such instances, third-party applications like SQL Password Recovery Tool play the required role.

That’s all about how to reset SQL passwords in all possible situations. Finally, go through all the methods and choose the appropriate one.


Q-1. Is it possible to execute SQL password reset command automatically?

Ans: No, Users need to execute these commands manually untill they have stored procedures for the same. It’s better to directly take help from any automated tool.

Q-2. Can this tool recover complete SQL database? 

Ans: No, this only works for password recovery. Users can take help from SQL recovery tool to get complete database recovered & repaired.

Q-3. What’s the price of this software to reset password SQL Server?

Ans: This advanced software is available at just $69 for a lifetime license on a single device.