Share via


sys.dm_server_audit_status (Transact-SQL)

Returns a row for each server audit indicating the current state of the audit. For more information, see Understanding SQL Server Audit.

Column name

Data type

Description

audit_id

int

ID of the audit. Maps to the audit_id field in the sys.audits catalog view.

name

sysname

Name of the audit. Same as the name field in the sys.server_audits catalog view.

status

tinyint

Numeric status of the server audit:

0 – Started

1 – Failed

status_desc

nvarchar(60)

String that shows the status of the server audit:

- STARTED

- FAILED

status_time

datetime2

Timestamp in UTC of the last status change for the audit.

event_session_address

varbinary(8)

Address of the Extended Events session associated with the audit. Related to the sys.db_xe_sessions.address catalog view.

active_file_name

nvarchar(260)

Full path name of the audit file target that is currently being used. Only populated for file audits.

size

bigint

Approximate size of the audit file, in kilobytes. Only populated for file audits.

Permissions

Principals must have VIEW SERVER STATE and SELECT permissions.

In SQL Server 2005 and later versions, the visibility of the metadata in catalog views is limited to securables that a user either owns or on which the user has been granted some permission. For more information, see Metadata Visibility Configuration.

See Also

Reference

Concepts