Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 2.19 KB

File metadata and controls

67 lines (47 loc) · 2.19 KB
title DROP EVENT SESSION (Transact-SQL)
description DROP EVENT SESSION drops an Extended Event session.
author markingmyname
ms.author maghan
ms.reviewer dfurman, randolphwest
ms.date 09/02/2025
ms.service sql
ms.subservice t-sql
ms.topic reference
f1_keywords
DROP_EVENT_SESSION_TSQL
DROP EVENT SESSION
helpviewer_keywords
event sessions [SQL Server]
DROP EVENT SESSION statement
dev_langs
TSQL

DROP EVENT SESSION (Transact-SQL)

[!INCLUDE SQL Server]

Drops an event session.

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

Syntax

DROP EVENT SESSION event_session_name
ON { SERVER | DATABASE }

Arguments

event_session_name

The name of an existing event session.

Remarks

When you drop an event session, all configuration information, such as targets and session parameters, is completely removed.

Permissions

SQL Server and Azure SQL Managed Instance require the DROP ANY EVENT SESSION (introduced in SQL Server 2022), or ALTER ANY EVENT SESSION permission.

Azure SQL Database requires the DROP ANY DATABASE EVENT SESSION permission in the database.

Tip

SQL Server 2022 introduced more granular permissions for Extended Events. For more information, see Blog: New granular permissions for SQL Server 2022 and Azure SQL to improve adherence with PoLP.

Examples

The following example shows how to drop an event session. To use this example with database event sessions, replace ON SERVER with ON DATABASE.

DROP EVENT SESSION test_session ON SERVER;

Related content