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

Enable the sa User in SQL Server 2019 with SSMS

This guide shows you how to turn on the sa login in SQL Server 2019. It is off by default on many installs.

Windows Hosting2 min read19 steps9 screenshots

What is the sa user?

SQL Server is a program that keeps data in tables. The sa login is its built-in administrator, short for "system administrator". It can do anything. It stays disabled when SQL Server uses only Windows logins. To use it, you must switch on a mode that allows SQL logins and then enable the account.

SSMS (SQL Server Management Studio) is the window-based tool we use here.

Screenshot: SSMS (SQL Server Management Studio) is the window-based tool we use here.
Warning: The sa account is a common target for attackers. Use a very strong password. Only enable it if you really need it. Take a backup before changing server settings.

Step 1: Allow SQL Server logins

  1. Open SSMS and connect with Windows Authentication.
    Screenshot: Open SSMS and connect with Windows Authentication .
  2. Right-click the server name at the top of the left panel.
  3. Click Properties.
  4. Click Security in the left list.
  5. Under Server authentication, choose SQL Server and Windows Authentication mode. This is also called mixed mode.
  6. Click OK. A message says you must restart the service. Click OK again.

Step 2: Set a password and enable sa

  1. In the left panel, expand Security, then Logins.
    Screenshot: In the left panel, expand Security , then Logins .
    Screenshot: In the left panel, expand Security , then Logins .
  2. Right-click sa and choose Properties.
    Screenshot: Right-click sa and choose Properties .
  3. On the General page, type a strong password twice.
  4. Click Status in the left list.
  5. Under Login, choose Enabled.
    Screenshot: Under Login , choose Enabled .
  6. Under Permission to connect to database engine, choose Grant.
    Screenshot: Under Permission to connect to database engine , choose Grant .
  7. Click OK.

Step 3: Restart SQL Server

  1. Right-click the server name in SSMS.
  2. Click Restart and confirm.
  3. Wait until the server is back.

Restarting stops the database for a moment. Websites that use it will lose their connection for a short time. Choose a quiet time.

Use a query instead

Click New Query, paste this and press F5:

ALTER LOGIN sa ENABLE;
ALTER LOGIN sa WITH PASSWORD = 'YourStrongPassword';

The first line turns the login on. The second sets its password. You still need mixed mode and a restart.

Test the login

  1. Click File, then Connect Object Explorer.
  2. Choose SQL Server Authentication.
    Screenshot: Choose SQL Server Authentication .
  3. Type sa and the password, then click Connect.

Quick recap

  • Switch the server to mixed mode in Properties, then Security.
  • Set a strong password for sa and set its status to Enabled.
    Screenshot: Set a strong password for sa and set its status to Enabled .
  • Restart SQL Server.
  • Test the login and keep the password private.