I'm using SQL Server 2005 Enterprise Edition. What I need to do is read an unknown number of tracefiles into a database table (I can create the table to load if needed). I know I can use SQL Profiler to do this, open the trace file in profiler then select Save As--> Trace table. What I want to do is something that will automate this process.

I know there is the function fn_trace_gettable that will read from the first trace in a series to the last, but unfortunately the results are not sequential. The trace stops at a file size of 5 Meg and start a new one with a different name. Since the fn_trace_gettable function relies on the start trace and end trace markers in the files I can not use this.

I already have a method but that involves opening each file in SQL Profiler and then saving it. I then run an batch process to generate a summary report of the data in the traces.

Any help ideas would be greatly appreciated.

Gary