Skip to content

Latest commit

 

History

History
83 lines (64 loc) · 4.32 KB

drop-server-audit-transact-sql.md

File metadata and controls

83 lines (64 loc) · 4.32 KB
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
DROP SERVER AUDIT (Transact-SQL)
DROP SERVER AUDIT drops a server audit object using the SQL Server Audit feature.
sravanisaluru
srsaluru
randolphwest
11/25/2024
sql
t-sql
reference
DROP SERVER AUDIT
DROP_SERVER_AUDIT_TSQL
DROP SERVER AUDIT statement
TSQL

DROP SERVER AUDIT (Transact-SQL)

[!INCLUDE SQL Server]

Drops a server audit object using the SQL Server Audit feature. For more information on SQL Server Audit, see SQL Server Audit (Database Engine).

:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions

Syntax

DROP SERVER AUDIT audit_name
[ ; ]

Remarks

You must set the State of an audit to the OFF option in order to make any changes to an Audit. If you run DROP AUDIT while an audit is enabled with any options other than STATE = OFF, you receive a MSG_NEED_AUDIT_DISABLED error message.

A DROP SERVER AUDIT removes the metadata for the Audit, but not the audit data that was collected before the command was issued.

DROP SERVER AUDIT doesn't drop associated server or database audit specifications. These specifications must be dropped manually or left orphaned and later mapped to a new server audit.

Permissions

To create, alter, or drop a Server Audit Principal, you need ALTER ANY SERVER AUDIT or CONTROL SERVER permissions.

Examples

The following example drops an audit called HIPAA_Audit.

ALTER SERVER AUDIT HIPAA_Audit
WITH (STATE = OFF);
GO

DROP SERVER AUDIT HIPAA_Audit;
GO

Transact-SQL reference

Related content