Skip to content

Commit 3c5ca21

Browse files
authored
Merge pull request #36708 from VanMSFT/vanmsft/uuf-security-batch4
Address 5 UUF items: ledger digest, query store permissions, audit cross-refs, login failed applicability
2 parents cb166f4 + cf9f6da commit 3c5ca21

4 files changed

Lines changed: 59 additions & 50 deletions

File tree

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,51 @@
11
---
2-
title: "Audit Login Failed Event Class"
3-
description: "Audit Login Failed Event Class"
2+
title: "Audit Login Failed event class"
3+
description: "Audit Login Failed event class"
44
author: WilliamDAssafMSFT
55
ms.author: wiassaf
6-
ms.date: "03/14/2017"
6+
ms.date: 02/25/2026
77
ms.service: sql
88
ms.subservice: supportability
99
ms.topic: reference
1010
helpviewer_keywords:
1111
- "Audit Login Failed event class"
12-
monikerRange: "=azuresqldb-current||>=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current"
12+
monikerRange: ">=sql-server-2016||>=sql-server-linux-2017||=azuresqldb-mi-current"
1313
---
14-
# Audit Login Failed Event Class
15-
[!INCLUDE [SQL Server Azure SQL Database Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
16-
The **Audit Login Failed** event class indicates that a user tried to log in to [!INCLUDE[msCoName](../../includes/msconame-md.md)] [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] and failed. Events in this class are fired by new connections or by connections that are reused from a connection pool.
17-
18-
## Audit Login Failed Event Class Data Columns
19-
20-
|Data column name|Data type|Description|Column ID|Filterable|
21-
|----------------------|---------------|-----------------|---------------|----------------|
22-
|**ApplicationName**|**nvarchar**|Name of the client application that created the connection to an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. This column is populated with the values passed by the application rather than the displayed name of the program.|10|Yes|
23-
|**ClientProcessID**|**int**|ID assigned by the host computer to the process where the client application is running. This data column is populated if the client process ID is provided by the client.|9|Yes|
24-
|**DatabaseID**|**int**|ID of the database specified by the USE *database* statement or the default database if no USE *database* statement has been issued for a given instance. [!INCLUDE[ssSqlProfiler](../../includes/sssqlprofiler-md.md)] displays the name of the database if the **ServerName** data column is captured in the trace and the server is available. Determine the value for a database by using the DB_ID function.|3|Yes|
25-
|**DatabaseName**|**nvarchar**|Name of the database in which the user statement is running.|35|Yes|
26-
|**Error**|**int**|Error number of a given event. Often this is the error number stored in the **sys.messages** catalog view.|31|Yes|
27-
|**EventClass**|**int**|Type of event = 20.|27|No|
28-
|**EventSequence**|**int**|The sequence of a given event within the request.|51|No|
29-
|**HostName**|**nvarchar**|Name of the computer on which the client is running. This data column is populated if the host name is provided by the client. To determine the host name, use the HOST_NAME function.|8|Yes|
30-
|**IsSystem**|**int**|Indicates whether the event occurred on a system process or a user process. 1 = system, 0 = user.|60|Yes|
31-
|**LoginName**|**nvarchar**|Name of the login of the user (either [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] security login or the Windows login credentials in the form of DOMAIN\username).|11|Yes|
32-
|**NTDomainName**|**nvarchar**|Windows domain to which the user belongs.|7|Yes|
33-
|**NTUserName**|**nvarchar**|Windows user name.|6|Yes|
34-
|**RequestID**|**int**|The ID of the request containing the statement.|49|Yes|
35-
|**ServerName**|**nvarchar**|Name of the instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] being traced.|26|No|
36-
|**SessionLoginName**|**nvarchar**|Login name of the user who originated the session. For example, if you connect to [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] using Login1 and execute a statement as Login2, **SessionLoginName** shows Login1 and **LoginName** shows Login2. This column displays both [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] and Windows logins.|64|Yes|
37-
|**SPID**|**int**|ID of the session on which the event occurred.|12|Yes|
38-
|**StartTime**|**datetime**|Time at which the event started, if available.|14|Yes|
39-
|**Success**|**int**|1 = success. 0 = failure. This event will always show failure.|23|Yes|
40-
|**TextData**|**ntext**|Text value dependent on the event class captured in the trace.|1|Yes|
41-
42-
## See Also
43-
[Extended Events](../../relational-databases/extended-events/extended-events.md)
44-
[sp_trace_setevent (Transact-SQL)](../../relational-databases/system-stored-procedures/sp-trace-setevent-transact-sql.md)
45-
46-
14+
# Audit Login Failed event class
15+
16+
[!INCLUDE [SQL Server Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdbmi.md)]
17+
18+
The **Audit Login Failed** event class indicates that a user tried to sign in to [!INCLUDE [msCoName](../../includes/msconame-md.md)] [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] and failed. Events in this class are fired by new connections or by connections that are reused from a connection pool.
19+
20+
This event class is part of [SQL Trace](../sql-trace/sql-trace.md), which is deprecated. For Azure SQL Database, use [auditing for Azure SQL Database](/azure/azure-sql/database/auditing-overview) instead.
21+
22+
## Audit Login Failed event class data columns
23+
24+
|Data column name|Data type|Description|Column ID|Filterable|
25+
|---|---|---|---|---|
26+
|**ApplicationName**|**nvarchar**|Name of the client application that created the connection to an instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. This column is populated with the values passed by the application instead of the displayed name of the program.|10|Yes|
27+
|**ClientProcessID**|**int**|ID assigned by the host computer to the process where the client application is running. This data column is populated if the client process ID is provided by the client.|9|Yes|
28+
|**DatabaseID**|**int**|ID of the database specified by the USE *database* statement or the default database if no USE *database* statement has been issued for a given instance. [!INCLUDE [ssSqlProfiler](../../includes/sssqlprofiler-md.md)] displays the name of the database if the **ServerName** data column is captured in the trace and the server is available. Determine the value for a database by using the DB_ID function.|3|Yes|
29+
|**DatabaseName**|**nvarchar**|Name of the database in which the user statement is running.|35|Yes|
30+
|**Error**|**int**|Error number of a given event. Often this is the error number stored in the **sys.messages** catalog view.|31|Yes|
31+
|**EventClass**|**int**|Type of event = 20.|27|No|
32+
|**EventSequence**|**int**|The sequence of a given event within the request.|51|No|
33+
|**HostName**|**nvarchar**|Name of the computer on which the client is running. This data column is populated if the host name is provided by the client. To determine the host name, use the HOST_NAME function.|8|Yes|
34+
|**IsSystem**|**int**|Indicates whether the event occurred on a system process or a user process. 1 = system, 0 = user.|60|Yes|
35+
|**LoginName**|**nvarchar**|Name of the login of the user (either [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] security login or the Windows login credentials in the form of DOMAIN\username).|11|Yes|
36+
|**NTDomainName**|**nvarchar**|Windows domain to which the user belongs.|7|Yes|
37+
|**NTUserName**|**nvarchar**|Windows user name.|6|Yes|
38+
|**RequestID**|**int**|The ID of the request containing the statement.|49|Yes|
39+
|**ServerName**|**nvarchar**|Name of the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] being traced.|26|No|
40+
|**SessionLoginName**|**nvarchar**|Login name of the user who originated the session. For example, if you connect to [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] using Login1 and execute a statement as Login2, **SessionLoginName** shows Login1 and **LoginName** shows Login2. This column displays both [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] and Windows logins.|64|Yes|
41+
|**SPID**|**int**|ID of the session on which the event occurred.|12|Yes|
42+
|**StartTime**|**datetime**|Time at which the event started, if available.|14|Yes|
43+
|**Success**|**int**|1 = success. 0 = failure. This event always shows failure.|23|Yes|
44+
|**TextData**|**ntext**|Text value dependent on the event class captured in the trace.|1|Yes|
45+
46+
## Related content
47+
48+
- [Extended Events overview](../extended-events/extended-events.md)
49+
- [sp_trace_setevent (Transact-SQL)](../system-stored-procedures/sp-trace-setevent-transact-sql.md)
50+
- [SQL Trace](../sql-trace/sql-trace.md)
51+
- [Auditing for Azure SQL Database and Azure Synapse Analytics](/azure/azure-sql/database/auditing-overview)

docs/relational-databases/security/auditing/sql-server-audit-database-engine.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn about server audits for the SQL Server Database Engine or an
44
author: sravanisaluru
55
ms.author: srsaluru
66
ms.reviewer: vanto, randolphwest
7-
ms.date: 06/11/2025
7+
ms.date: 02/25/2026
88
ms.service: sql
99
ms.subservice: security
1010
ms.topic: concept-article
@@ -51,7 +51,7 @@ The server audit specification collects many server-level action groups raised b
5151
Server-level audit action groups are described in the article [SQL Server Audit action groups and actions](sql-server-audit-action-groups-and-actions.md).
5252

5353
> [!NOTE]
54-
> Due to performance constraints, we don't audit the `tempdb` and temporary tables. While the batch completed action group captures statements against temporary tables, it might not correctly populate the object names. However, the source table is always audited, ensuring that all inserts from the source table to temporary tables are recorded.
54+
> Due to performance constraints, `tempdb` and temporary tables aren't audited. While the batch completed action group captures statements against temporary tables, it might not correctly populate the object names. However, the source table is always audited, ensuring that all inserts from the source table to temporary tables are recorded.
5555
5656
### Database Audit Specification
5757

@@ -80,7 +80,7 @@ When you're saving audit information to a file, to help prevent tampering, you c
8080

8181
Even when the [!INCLUDE [ssDE](../../../includes/ssde-md.md)] is writing to a file, other Windows users can read the audit file if they have permission. The [!INCLUDE [ssDE](../../../includes/ssde-md.md)] doesn't take an exclusive lock that prevents read operations.
8282

83-
Because the [!INCLUDE [ssDE](../../../includes/ssde-md.md)] can access the file, [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] logins that have `CONTROL SERVER` permission can use the [!INCLUDE [ssDE](../../../includes/ssde-md.md)] to access the audit files. To record any user that is reading the audit file, define an audit on `master.sys.fn_get_audit_file`. This records the logins with `CONTROL SERVER` permission that have accessed the audit file through [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)].
83+
Because the [!INCLUDE [ssDE](../../../includes/ssde-md.md)] can access the file, [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)] logins that have `CONTROL SERVER` permission can use the [!INCLUDE [ssDE](../../../includes/ssde-md.md)] to access the audit files. In [!INCLUDE [sssql22-md](../../../includes/sssql22-md.md)] and later versions, the `VIEW SERVER SECURITY AUDIT` permission is sufficient to read audit files using `fn_get_audit_file`. To record any user that is reading the audit file, define an audit on `master.sys.fn_get_audit_file`. This records the logins with `CONTROL SERVER` permission that have accessed the audit file through [!INCLUDE [ssNoVersion](../../../includes/ssnoversion-md.md)]. For more information about `fn_get_audit_file` permissions, see [sys.fn_get_audit_file](../../system-functions/sys-fn-get-audit-file-transact-sql.md).
8484

8585
If an Audit Administrator copies the file to a different location (for archive purposes, and so on), the access control lists (ACLs) on the new location should be reduced to the following permissions:
8686

@@ -193,6 +193,8 @@ To create, alter, or drop a Server Audit or Server Audit Specification, server p
193193

194194
The `VIEW ANY DEFINITION` permission provides access to view the server level audit views and `VIEW DEFINITION` provides access to view the database level audit views. Denial of these permissions overrides the ability to view the catalog views, even if the principal has the `ALTER ANY SERVER AUDIT` or `ALTER ANY DATABASE AUDIT` permissions.
195195

196+
To read audit data using `fn_get_audit_file`, [!INCLUDE [sssql19-md](../../../includes/sssql19-md.md)] and earlier versions require `CONTROL SERVER` permission on the server, while [!INCLUDE [sssql22-md](../../../includes/sssql22-md.md)] and later versions require `VIEW SERVER SECURITY AUDIT` permission. For more information, see [sys.fn_get_audit_file](../../system-functions/sys-fn-get-audit-file-transact-sql.md).
197+
196198
For more information about how to grant rights and permissions, see [GRANT](../../../t-sql/statements/grant-transact-sql.md).
197199

198200
> [!CAUTION]

docs/relational-databases/security/ledger/ledger-limits.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Limitations and considerations for the ledger feature
44
author: VanMSFT
55
ms.author: vanto
66
ms.reviewer: mathoma
7-
ms.date: 11/28/2023
7+
ms.date: 02/25/2026
88
ms.service: sql
99
ms.subservice: security
1010
ms.custom:
@@ -25,9 +25,9 @@ There are some considerations and limitations to be aware of when working with l
2525
Consider the following when working with ledger.
2626

2727
- A [ledger database](ledger-database-ledger.md), a database with the ledger property set to on, can't be converted to a regular database, with the ledger property set to off.
28-
- Automatic generation and storage of database digests is currently available in Azure SQL Database, but not supported on SQL Server.
28+
- Automatic generation and storage of database digests is available in Azure SQL Database and SQL Server 2022. In SQL Server, you can configure automatic digest storage using `ALTER DATABASE SCOPED CONFIGURATION`. For more information, see [Enable automatic digest storage](ledger-how-to-enable-automatic-digest-storage.md).
2929
- Automated digest management with ledger tables by using [Azure Storage immutable blobs](/azure/storage/blobs/immutable-storage-overview) doesn't offer the ability for users to use [locally redundant storage (LRS)](/azure/storage/common/storage-redundancy#locally-redundant-storage) accounts.
30-
- When a ledger database is created, all new tables created by default (without specifying the `APPEND_ONLY = ON` clause) in the database will be [updatable ledger tables](ledger-updatable-ledger-tables.md). To create [append-only ledger tables](ledger-append-only-ledger-tables.md), use the `APPEND_ONLY = ON` clause in the [CREATE TABLE (Transact-SQL)](../../../t-sql/statements/create-table-transact-sql.md) statements.
30+
- When a ledger database is created, all new tables created by default (without specifying the `APPEND_ONLY = ON` clause) in the database are [updatable ledger tables](ledger-updatable-ledger-tables.md). To create [append-only ledger tables](ledger-append-only-ledger-tables.md), use the `APPEND_ONLY = ON` clause in the [CREATE TABLE (Transact-SQL)](../../../t-sql/statements/create-table-transact-sql.md) statements.
3131
- A transaction can update up to 200 ledger tables.
3232

3333
## Ledger table considerations and limitations
@@ -42,7 +42,7 @@ Consider the following when working with ledger.
4242
- SWITCH IN/OUT partition isn't supported.
4343
- DBCC CLONEDATABASE isn't supported.
4444
- Ledger tables can't have full-text indexes.
45-
- Ledger tables can't be graph table.
45+
- Ledger tables can't be a graph table.
4646
- Ledger tables can't be FileTables.
4747
- Ledger tables can't have a rowstore non-clustered index when they have a clustered columnstore index.
4848
- Change tracking isn't allowed on the history table but is allowed on ledger tables.
@@ -64,7 +64,7 @@ Consider the following when working with ledger.
6464

6565
### Temporal table limitations
6666

67-
Updatable ledger tables are based on the technology of [temporal tables](../../tables/temporal-tables.md) and inherit most of the [limitations](../../tables/temporal-table-considerations-and-limitations.md) but not all of them. Below is a list of limitations that is inherited from temporal tables.
67+
Updatable ledger tables are based on the technology of [temporal tables](../../tables/temporal-tables.md) and inherit most of the [limitations](../../tables/temporal-table-considerations-and-limitations.md) but not all of them. The following list describes limitations inherited from temporal tables.
6868

6969
- If the name of a history table is specified during history table creation, you must specify the schema and table name and also the name of the ledger view.
7070
- By default, the history table is PAGE compressed.
@@ -75,7 +75,7 @@ Updatable ledger tables are based on the technology of [temporal tables](../../t
7575
- The history table must be created in the same database as the current table. Temporal querying over Linked Server isn't supported.
7676
- The history table can't have constraints (Primary Key, Foreign Key, table, or column constraints).
7777
- Online option (`WITH (ONLINE = ON`) has no effect on `ALTER TABLE ALTER COLUMN` in case of system-versioned temporal table. `ALTER COLUMN` isn't performed as online regardless of which value was specified for the `ONLINE` option.
78-
- `INSERT` and `UPDATE` statements can't reference the [GENERATED ALWAYS](../../../t-sql/statements/create-table-transact-sql.md#generate-always-columns) columns. Attempts to insert values directly into these columns will be blocked.
78+
- `INSERT` and `UPDATE` statements can't reference the [GENERATED ALWAYS](../../../t-sql/statements/create-table-transact-sql.md#generate-always-columns) columns. Attempts to insert values directly into these columns are blocked.
7979
- `UPDATETEXT` and `WRITETEXT` aren't supported.
8080
- Triggers on the history table aren't allowed.
8181
- Usage of replication technologies is limited:
@@ -97,7 +97,7 @@ Updatable ledger tables are based on the technology of [temporal tables](../../t
9797

9898
### Adding columns
9999

100-
Adding nullable columns is supported. Adding non-nullable columns is not supported. Ledger is designed to ignore NULL values when computing the hash of a row version. Based on that, when a nullable column is added, ledger will modify the schema of the ledger and history tables to include the new column, however, this doesn't impact the hashes of existing rows. Adding columns in ledger tables is captured in [sys.ledger_column_history](../../system-catalog-views/sys-ledger-column-history-transact-sql.md).
100+
Adding nullable columns is supported. Adding non-nullable columns isn't supported. Ledger is designed to ignore NULL values when computing the hash of a row version. Based on that, when a nullable column is added, ledger modifies the schema of the ledger and history tables to include the new column, however, this doesn't impact the hashes of existing rows. Adding columns in ledger tables is captured in [sys.ledger_column_history](../../system-catalog-views/sys-ledger-column-history-transact-sql.md).
101101

102102
### Dropping columns and tables
103103

@@ -110,7 +110,7 @@ Normally, dropping a column or table completely erases the underlying data from
110110
> [!NOTE]
111111
> The name of dropped ledger tables, history tables and ledger views might be truncated if the length of the renamed table or view exceeds 128 characters.
112112
113-
### Altering Columns
113+
### Altering columns
114114

115115
Any changes that don't impact the underlying data of a ledger table are supported without any special handling as they don't impact the hashes being captured in the ledger. These changes include:
116116

docs/relational-databases/system-catalog-views/sys-database-query-store-options-transact-sql.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: sys.database_query_store_options returns the Query Store options fo
44
author: rwestMSFT
55
ms.author: randolphwest
66
ms.reviewer: wiassaf, randolphwest
7-
ms.date: 05/23/2024
7+
ms.date: 02/25/2026
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -55,7 +55,9 @@ Returns the Query Store options for this database.
5555

5656
## Permissions
5757

58-
Requires the `VIEW DATABASE STATE` permission.
58+
Requires the `VIEW DATABASE PERFORMANCE STATE` permission, or a greater permission such as `VIEW DATABASE STATE`.
59+
60+
In [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] through [!INCLUDE [sssql19-md](../../includes/sssql19-md.md)], requires the `VIEW DATABASE STATE` permission. In [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions, requires the `VIEW DATABASE PERFORMANCE STATE` permission on the database, or a greater permission such as `VIEW DATABASE STATE`.
5961

6062
## Remarks
6163

0 commit comments

Comments
 (0)