Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
Analytics Platform System (PDW)
Returns one row for every SQL Server authentication login.
Column name | Data type | Description |
---|---|---|
<inherited columns> |
N/A | Inherits from sys.server_principals . |
is_policy_checked |
bit | Password policy is checked. |
is_expiration_checked |
bit | Password expiration is checked. |
password_hash |
varbinary(256) | Hash of SQL login password. In SQL Server 2022 (16.x) and earlier versions, the stored password information is calculated using SHA-512 of the salted password. Starting with SQL Server 2025 (17.x) Preview, an iterated hash algorithm, RFC2898 (PBKDF), is used. The first byte of the hash indicates the version: 0x02 for version 2 (SQL Server 2022 (16.x) and earlier versions) and 0x03 for version 3 (SQL Server 2025 (17.x) Preview and later versions). |
For a list of columns that this view inherits, see sys.server_principals. The columns owning_principal_id
and is_fixed_role
isn't inherited from sys.server_principals.
Remarks
To view both SQL Server authentication logins and Windows authentication logins, see sys.server_principals.
When contained database users are enabled, connections can be made without logins. To identify those accounts, see sys.database_principals.
Permissions
In SQL Server, any SQL Server authentication login can see their own login name, and the sa
login. To see other logins, the principal requires ALTER ANY LOGIN
, VIEW SERVER SECURITY DEFINITION
, or a permission on the login.
To view the contents of the password_hash column
, CONTROL SERVER
is required. Starting with SQL Server 2022 (16.x), VIEW ANY CRYPTOGRAPHICALLY SECURED DEFINITION
permission is required.
In Azure SQL Database, only members of the special database role loginmanager in master
or the Microsoft Entra Admin and Server Admin can see all logins.
The visibility of the metadata in catalog views is limited to securables that a user either owns, or on which the user was granted some permission. For more information, see Metadata Visibility Configuration.