Extended Events (XE) is the modern, low-overhead tracing framework that has replaced SQL Profiler and SQL Trace for the SQL Server Database Engine.
For new performance work, use Extended Events: it costs less overhead, covers more events, and filters far better than Profiler. Microsoft announced SQL Trace and Profiler for the Database Engine as deprecated back in SQL Server 2012.
If you are choosing how to capture what your SQL Server is doing, this is a short decision: Extended Events for anything new, especially on production. Here is why — and the few situations where Profiler still turns up.
Why Extended Events replaced Profiler
Extended Events wins on the three things that matter for tracing a busy server.
Overhead
Extended Events was built to be lightweight. Per benchmarks published on SQLPerformance.com, Extended Events generally imposes less overhead than even a server-side SQL Trace, while SQL Server Profiler — which streams every event to a client application — adds the most overhead of all and can sharply reduce throughput on a busy server. On production, that difference alone settles the question.
Event coverage and detail
Ever since Extended Events shipped in SQL Server 2008, it has exposed more events than SQL Trace, and it captures detail Profiler cannot — for example, the object_id of a stored procedure, so you can aggregate calls by object without parsing T-SQL text. New engine features such as AlwaysOn, Columnstore, and In-Memory OLTP (Hekaton) are only traceable through Extended Events.
Filtering
Extended Events offers far more precise filtering than Profiler or SQL Trace, so you capture only the events you care about — which both reduces overhead and makes the captured data easier to analyze.
At a glance
| Extended Events | SQL Profiler / Trace | |
|---|---|---|
| Status (Database Engine) | Current, recommended | Deprecated since SQL Server 2012 |
| Overhead | Lowest | Highest (Profiler streams to client) |
| Event coverage | Most events; modern features | Fewer; no new features |
| Filtering | Rich, predicate-based | Limited |
| UI | SSMS sessions (Profiler-style templates since 2016) | Profiler GUI |
When Profiler still appears
Profiler has not vanished, and there are understandable reasons it lingers: it is familiar, and for a quick ad-hoc look on a non-production box the GUI is convenient. But none of these are reasons to build new, ongoing tracing on it. Since SQL Server 2016, SSMS provides Extended Events session templates that mirror the old Profiler templates, so the familiarity gap has largely closed.
Do not run SQL Server Profiler against a busy production instance to diagnose performance — the observer overhead can itself degrade the workload you are trying to measure. Use a lightweight Extended Events session instead.
A minimal performance-capture session
This Extended Events session captures completed batches and RPC calls over a duration threshold — a practical starting point for finding expensive statements:
Lightweight Extended Events sessionCREATE EVENT SESSION [perf_capture] ON SERVER
ADD EVENT sqlserver.rpc_completed (
ACTION (sqlserver.sql_text, sqlserver.database_name)
WHERE (duration > 100000) -- microseconds: > 100 ms
),
ADD EVENT sqlserver.sql_batch_completed (
ACTION (sqlserver.sql_text, sqlserver.database_name)
WHERE (duration > 100000)
)
ADD TARGET package0.event_file (SET filename = N'perf_capture.xel');
GO
ALTER EVENT SESSION [perf_capture] ON SERVER STATE = START;
Why this matters for optimization
A real performance baseline has to come from real traffic, and Extended Events is how you capture it without distorting the result. That baseline is the foundation of the whole optimization loop — you cannot prove a rewrite helped without a trustworthy "before."
SprocOptimizer uses Extended Events as its measurement engine: it captures real executions of a target procedure to establish the baseline, then traces the optimized version to produce a like-for-like before/after comparison — all on-premises.
Next: find your slowest procedures, then work the full optimization loop.
Frequently asked questions
Yes. Microsoft announced SQL Trace and SQL Server Profiler for the Database Engine as deprecated starting with SQL Server 2012, and recommends Extended Events as the replacement. Profiler still ships and runs, but no new development goes into it for the Database Engine.
Extended Events (XE) replaced SQL Profiler and SQL Trace for the SQL Server Database Engine. Extended Events is a lighter-weight, more configurable framework that covers more events and supports modern features that SQL Trace never gained.
Yes. Extended Events was designed for low overhead and generally costs less than even a server-side SQL Trace, while SQL Server Profiler — which streams events to a client — adds the most overhead and is the option to avoid on busy production servers. This is why Extended Events is the recommended way to trace performance on production.
For the Database Engine, Extended Events can do everything Profiler can and more. It exposes more events, captures details Profiler cannot (such as the object_id of a stored procedure), offers far better filtering, and is the only option for tracing newer features like AlwaysOn, Columnstore, and In-Memory OLTP. Since SQL Server 2016, SSMS also provides Profiler-style templates for Extended Events sessions.
Primary sources & further reading
- MSSQLTips — Extended Events vs Profiler vs Trace.
- SQLPerformance.com — Measuring observer overhead of SQL Trace vs. Extended Events.
- Grant Fritchey — Profiler and Trace vs. Extended Events.
A trustworthy before/after, automatically
SprocOptimizer uses Extended Events to baseline a procedure and measure the optimized version like-for-like — on-premises, with no row-level data leaving your network.
Request a Demo See How It Works