profiler trace

Using T-SQL to read Profiler Trace files in SSMS

Once you have stopped the trace, you can read the contents of the .trc file using fn_trace_gettable.

Below is a step-by-step guide to that saves a SQL Server profiler trace to a file, stores it in a specified drive, and then reads it using the fn_trace_gettable function in SSMS.

SELECT * FROM fn_trace_gettable('C:\naren\trace.trc', DEFAULT);

This script will help you to read a SQL Server Profiler trace file using SQL Server Management Studio (SSMS).