SQL Server Profiler Replay a Trace Table

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

The ability to open and replay a previously saved trace is known as a replay. A multithreaded replay engine in SQL Server Profiler can simulate user connections and SQL Server Authentication. It is very helpful while troubleshooting an application.

Let's open the SQL Server Profiler and go to the File > New Trace... menu.

image

It will open the Connect to Server dialog.

image

Click on the Connect button to connect to an instance of SQL Server and then it will open the Tace Properties dialog.

image

In the Trace name field, type a name for the trace, and in the Use the template list, select a TSQL_Replay template, choose the Save to table option, and connect to the server.

image

Select the destination table and click the OK button.

image

Let's review the Events Selection tab.

image

You will see the required events classes for Replay. Now run the trace by clicking on the Run button and then open a query editor and execute a simple query.

image

When you execute this simple query and then go to the SQL Server Profiler, you will see the query logs.

image

Now close the trace and open the trace table again from the File > Open > Trace Table...

image

Select a trace table on the Source Table dialog and click the OK button.

image

Select the Replay > Start menu, and connect to the server instance where you want to replay the trace.

image

It will open the Replay Configuration dialog. On the Basic Replay Options tab, specify Replay server.

image

You can save the replay in either a file or database table. So let's select Save to file option and specify the file.

In the Replay options section, choose the Replay the events in the order they were traced option and select the Display replay results to view the replay as it occurs and click the Advanced Replay Options tab.

image

Select Replay system SPIDs and then click the OK button.

image

You can see the replayed events.



Got any SQL Server Profiler Question?