logo
SQL Password Change SQL Server Forgotten SA Password

4 Effective Ways to Change SQL Server SA Password

By Hally | Last Updated

Have you ever tried to clear SA password by reinstalling SQL Server after SA password forgot? If you are sure, it's time to discontinue when you encounter the same problem. Several good ways have been introduced in this article for SQL Server users to change SQL Server SA password effectively.

Way 1: Change SQL Server SA Password by Windows Authentication

After SQL Server installation on computer, as long as you have admin privileges to Windows computer, generally built-in administrators are present in SQL Server. So when you are logged in Windows computer with administrator, you could use Windows Authentication to connect to SQL Server and change SQL Server SA password in Login Properties.

Step 1: Open SQL Server Management Studio (SSMS).

You can open it by clicking Start All Programs Microsoft SQL Server 2005 SQL Server Management Studio Express.

Step 2: Choose Windows Authentication and connect to SQL Server.

Step 3: Once entering SQL Server, navigate to Object Explorer Security Logins sa. Right-click it and choose Properties.

navigate to SQL Server SA account properties

Step 4: Type a new password for sa and confirm it. Click OK to finish SA password change.

change SQL SA password in Windows Authentication mode

Now restart SQL Server and services, you can login into SQL Server with SA account and its new password when you choose "SQL Server Authentication" mode.

Way 2: Change SQL Server Password with Third-Party Software

Third-party software is surely one of best effective ways to change or reset SQL Server SA password for computer novices. For example, iSunshare SQL Password Genius makes SQL Server 2000/2005/2008/2012/2014/2016 SA password reset easy without any technique required. And there would be no influence on SQL Server database besides user password.

Step 1: Download and install SQL Password Genius on your computer.

Tips: Please open SQL Server Configuration Manager to stop SQL Server Services before running SQL Password Genius to change SQL Server user password.

Step 2: Run it and import locked SQL master *.mdf file.

Click Open File button on SQL Password Genius, and browse master.mdf file in computer to open it. It wil be shown in box. MDF file location: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data

open SQL Server database file in tool

Step 3: Select SA account in user list and reset password.

SA and other user accounts and password status will be listed in SQL Password Genius after importing MDF file. "Unknown" means user password is forgotten or lost. Select the sa account and click Reset button.

Instantly, a new dialog pops up. Type a new password in New Password box and click OK. Then SA password will be changed successfully and shown in user list.

change SQL Server SA password with tool

At this moment, users just need to close SQL Password Genius and restart SQL Server Services, SQL Server will be logged into with SA account and new password.

restart SQL Server Services

Tips: If you want to try other ways, even though they are not so easy as SQL Password Genius, go on to see followings.

Way 3: Change SQL Server SA Password with Command Prompt

Don't need to login into SQL Server, run Command Prompt to change SQL Server password.

Step 1: Click Start Run, and then type "cmd" in Run box. Press Enter to run Command Prompt.

Step 2: Type following commands, and press Enter after each command line.

osql -E
1> EXEC sp_password NULL, yourpassword, sa
2> GO

Tips: The first line is used to copy full name of SQL Server. The second line executes command to change SQL Server SA password.

Way 4: Change SQL Server Password with the Query in Management Studio

Step 1: Open SQL Server Management Studio.

Step 2: Click New Query on menu to open a new query.

Step 3: Type the following commands in query window:
GO
ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master]
GO
USE [master]
GO
ALTER LOGIN [sa] WITH PASSWORD=N'NewPassword' MUST_CHANGE
GO

Step 4: Execute the command. Then the new password is set for your SQL Server sa account.

Related Articles: