Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Change the sa Password in SQL Server 2019

This guide shows you how to set a new password for the sa user in SQL Server 2019. You will use a free tool called SSMS.

Windows Hosting2 min read11 steps6 screenshots

What is the sa user?

SQL Server is a program that stores data in tables, like a very big spreadsheet. The sa user is the main administrator account of that program. "sa" stands for "system administrator". Anyone who knows its password can do almost anything with your data. So the password must be strong and private.

SSMS is short for SQL Server Management Studio. It is a window-based tool that lets you manage SQL Server with your mouse.

Before you start: After you change the password, any website or program that uses the old password will stop connecting. Write down the places that use it, so you can update them. A backup of your databases is a good idea too.

Steps

  1. Open SSMS from the Start menu.
  2. In the Connect to Server box, choose Database Engine as the server type.
  3. Type your server name. If you are on the server itself, you can often type a dot (.) or the word localhost.
  4. Choose Windows Authentication and click Connect. Use a Windows account that has admin rights. If you use SQL Server Authentication instead, log in with a SQL login that has admin rights.
    Screenshot: Choose Windows Authentication and click Connect . Use a Windows account that has admin rig
    Screenshot: Choose Windows Authentication and click Connect . Use a Windows account that has admin rig
  5. In the left panel, click the small arrow beside Security.
  6. Open the Logins folder.
    Screenshot: Open the Logins folder.
    Screenshot: Open the Logins folder.
  7. Right-click sa and choose Properties.
    Screenshot: Right-click sa and choose Properties .
  8. On the General page, find the Password box and type your new password.
  9. Type the same password again in the Confirm password box.
  10. If the old password box is shown, you may need to fill it in. Tick or untick Specify old password as needed.
  11. Click OK to save.

Using a query instead

You can also change the password with a short command. Click New Query, paste the command, and press F5.

ALTER LOGIN sa WITH PASSWORD = 'YourNewStrongPassword';

This command sets the new password for the sa login. Replace the text inside the quotes with your own password.

Make a strong password

  • Use at least 12 characters.
  • Mix capital letters, small letters, numbers and symbols.
  • Do not use your name or your website name.
  • Do not reuse a password from another place.
Tip: If the sa login is disabled, you cannot log in with it even with the right password. See our guide on enabling the sa user.

Quick recap

  • Open SSMS and connect with an admin account.
  • Go to Security, then Logins, then right-click sa.
  • Choose Properties and type the new password twice.
    Screenshot: Choose Properties and type the new password twice.
  • Click OK and update every program that used the old password.