Today’s post is a short but extremely useful. I often find myself needing to import a trace I made previously into a table so I can peruse through the data in more meaningful ways. You would think that by this iteration of SQL they would have thought to have made the columns sortable in the GUI, but unfortunately they have not. In order to get the same result though we can import the data into a SQL table by using a simple select into using a system function called fn_trace_gettable. To see it in action create a profiler trace file and then run the following Query with your desired tablename and trace file location:
SELECT * INTO trace20100318 FROM ::fn_trace_gettable(‘c:trace20100318.trc’, default)
Now we can query the table and sort it any way we like. Enjoy!

