From b0b13953d54fa00c651a68f019546b1c14437ee0 Mon Sep 17 00:00:00 2001 From: Oberdan Schaider <65258315+oberdansch@users.noreply.github.com> Date: Fri, 12 Dec 2025 09:36:45 -0300 Subject: [PATCH] Update sys-server-file-audits-transact-sql.md Added retention_days. Update create-server-audit-transact-sql.md Added retention period --- .../sys-server-file-audits-transact-sql.md | 3 ++- docs/t-sql/statements/create-server-audit-transact-sql.md | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/relational-databases/system-catalog-views/sys-server-file-audits-transact-sql.md b/docs/relational-databases/system-catalog-views/sys-server-file-audits-transact-sql.md index b9d4e5054bc..a4793eedd3e 100644 --- a/docs/relational-databases/system-catalog-views/sys-server-file-audits-transact-sql.md +++ b/docs/relational-databases/system-catalog-views/sys-server-file-audits-transact-sql.md @@ -42,7 +42,8 @@ dev_langs: |max_files|**int**|Maximum number of files to use without the rollover option.| |reserved_disk_space|**int**|Amount of disk space to reserve per file.| |log_file_path|**nvarchar(260)**|Path to where audit is located. File path for file audit, application log path for application log audit.| -|log_file_name|**nvarchar(260)**|Base name for the log file supplied in the CREATE AUDIT DDL. An incremental number is added to the base_log_name file as a suffix to create the log file name.| +|log_file_name|**nvarchar(260)**|Base name for the log file supplied in the CREATE AUDIT DDL. An incremental number is added to the base_log_name file as a suffix to create the log file name.| +|retention_days|**int**|Lifetime in days of the audit log file. Applies to Azure SQL Database and Azure SQL Managed Instance

0 = Unlimited. | ## Permissions Principals with the **ALTER ANY SERVER AUDIT** or **VIEW ANY DEFINITION** permission have access to this catalog view. In addition, the principal must not be denied **VIEW ANY DEFINITION** permission. diff --git a/docs/t-sql/statements/create-server-audit-transact-sql.md b/docs/t-sql/statements/create-server-audit-transact-sql.md index 50cbc358225..518d100400e 100644 --- a/docs/t-sql/statements/create-server-audit-transact-sql.md +++ b/docs/t-sql/statements/create-server-audit-transact-sql.md @@ -55,6 +55,7 @@ CREATE SERVER AUDIT audit_name [ , ON_FAILURE = { CONTINUE | SHUTDOWN | FAIL_OPERATION } ] [ , AUDIT_GUID = uniqueidentifier ] [ , OPERATOR_AUDIT = { ON | OFF } ] + [ , RETENTION_DAYS = integer ] } ::= @@ -141,6 +142,12 @@ To support scenarios such as database mirroring or databases participating in an Indicates whether auditing captures Microsoft support engineer operations when they need to access your server during a support request. +#### RETENTION_DAYS + +**Applies to:** Azure SQL Managed Instance and Azure SQL Database only. + +Indicates the number of days of the audit log file storage period. + #### predicate_expression Specifies the predicate expression used to determine if an event should be processed or not. Predicate expressions are limited to a length of 3,000 characters, which limits string arguments.