Sql-server – Sql profiler replay table

profilersql-server-2008-r2

I have captured a trace in profiler and stored the trace to both a table and an xml for replay. I open the xml and replay the trace on the same server/database with modified stored procedures (I want to check the performance of some changes). In the replay options I choose "save to table" to store the replay results for later analysis. The replay went well with a few errors about 'bulk inserts' which I accept since the profiler documentation states that it does not replay bulk events.

My problem is that the replay trace table does not have the same columns as my original trace! specifically the duration and cpu columns. I really need these in order to compare the two sets of results. Is there anything I am missing in the replay setup or anywhere?

Thanks
dat_girl

Best Answer

Are you using one of the default traces in Profiler or are you creating it manually?

If I were in the same situation, I would just save the trace to a regular text file and then import that file into a SQL Server table.

USE mydb 
GO 

SELECT * INTO mytracetable FROM ::fn_trace_gettable('c:\my_trace.trc', default)
GO

At least that way you are certain to get the same columns everytime. As to the BULK INSERT statements, you could try this filter.

Column Filter for TextData with the Not Like set to %BULK INSERT%.