| title | Script an Extended Event Session | Microsoft Docs |
|---|---|
| ms.custom | |
| ms.date | 03/06/2017 |
| ms.prod | sql-server-2014 |
| ms.reviewer | |
| ms.technology | database-engine |
| ms.topic | conceptual |
| ms.assetid | 80f9fdde-1f13-4292-a4fc-55da826be3b4 |
| author | mashamsft |
| ms.author | mathoma |
| manager | craigg |
This topic describes how to script an event session. You can export, alter, or drop the event session, or drop and create the event session to the following:
-
New Query Editor Window
-
File
-
Clipboard
-
Agent Job
-
In Object Explorer, expand the Management node, and then expand Extended Events.
-
Right-click the session you want to script, point to Script Session as, point to CREATE to, and then select where you want to script the session.
-
In Object Explorer, expand the Management node, and then expand Extended Events.
-
Right-click Sessions, and then click New Session.
-
In the New Session UI, create the event session, and then select where you want to script the event session from the Script drop-down list.
-
In Object Explorer, expand the Management node, and then expand Extended Events.
-
Right-click the session you want to modify, and then click Properties.
-
In the Session Properties dialog box, modify the event session, and then select where you want to script the modified session from the Script drop-down list.