How to Change SA Password in SQL Server

Table of Contents

Method 1: Using Command Promt or Powershell

1. Right click on Windows icon then open Windows Powershell(Admin).

How to Change SA Password in SQL Server

2. Run this command to get the hostname of your SQL Server.

hostname

3. Run this command to connect to SQL server using single user mode. Replace servername by your SQL server hostname.

OSQL -S servername -E

4. Run this command to set a new password for the sa account.

EXEC sp_password NULL, 'NewPassword@', 'sa'
go
exit
How to Change SA Password in SQL Server

5. Now, open SSMS then connect to the SQL server using new password.

How to Change SA Password in SQL Server
How to Change SA Password in SQL Server

Method 2: Using SSMS

You can reset or change the sa account password using SQL Management Studio if the Authentication Mode of your SQL server is Mixed Mode.

1. Let open SSMS then connect to the SQL server using Windows Authentication.

How to Change SA Password in SQL Server

2. Right click on the sa account then select properties.

How to Change SA Password in SQL Server

3. Type a new password for the sa account then save the changes.

How to Change SA Password in SQL Server

Leave a Comment

Required fields are marked *