Exploring SQL Server Extended Events

Learn SQL with Udemy

For an instructor lead, in-depth look at learning SQL click below.


ploring SQL Server Extended Events

SQL Server Extended Events is a light-weight performance monitoring system that allows database administrators to collect as little or as much data as necessary to troubleshoot or identify a performance problem. It’s a highly customizable, event-driven data collection system that SQL Server uses to send data to users or other targets.

Extended Events use event processing sessions to control how the events are handled. These can be viewed using the sys.dm_xe_sessions dynamic management view.

**Creating an Extended Event Sessions**

To configure an extended events session, we use the CREATE EVENT SESSION command. We can specify features like the name of the session, the events we want to capture, and where we want to store those events.

Starting an Extended Event Session

We start a new session we’ve configured by using the ALTER EVENT SESSION command with the STATE = START argument.

Stopping an Extended Event Session

Similarly, to stop a session, we use the ALTER EVENT SESSION command with the STATE = STOP argument.

Dropping an Extended Event Session

To completely remove an extended event session, we can use the DROP EVENT SESSION command. This will deactivate the session and remove it from SQL Server.

Extended Events are a powerful tool in SQL Server for performance troubleshooting. They require some getting used to, but once mastered they offer unparalleled insight into what is happening on your SQL Server installation.

Leave a Comment