// SQL Server error reference

SQL Server error 18470: Login failed, account disabled

The SQL Server login exists but has been disabled, so SQL Server refuses it even with the right password.

Error number
18470
Severity
14
Category
Connection and login
Error message
Login failed for user '%.*ls'. Reason: The account is disabled.%.*ls

What it means

A login can be disabled with ALTER LOGIN ... DISABLE, which keeps the login and its permissions but blocks every connection. The sa login is disabled by default when SQL Server is installed in Windows authentication mode.

Common causes

  • An administrator disabled the login on purpose, for example while decommissioning an application.
  • The sa login is still disabled from installation.
  • A script or policy disabled logins after a security review.

How to fix it

  1. Check the login's state.

    SELECT name, is_disabled FROM sys.server_principals WHERE name = N'app_user';
  2. Enable it again if it should be allowed to connect.

    ALTER LOGIN app_user ENABLE;

Related errors

More connection and login errors

The code and message text are from the Microsoft Database Engine events and errors reference. Browse the full SQL Server error list or search every database error.

// fewer errors, faster fixes

Work on SQL Server in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQL Server and the other databases you use.