How to filter a SQL Profiler Trace

The easiest way I have found to filter down the results of a profiler trace is to dump it into a table and query the results from there.

This gives you a simple template you can use to insert the results of a SQL profiler trace
into a table. You can then easily query the result set to filter and work with the results.

SELECT * INTO TraceResults
FROM ::fn_trace_gettable('C:\Traces\Your_Trace.trc', default)

SELECT * FROM TraceResults
WHERE SPID = 56
Rob StGeorge
Senior SQL Server Database Administrator residing in Auckland, NZ

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.