Geeks With Blogs
marocanu2001 technicle blog

Nowdays I am in charge of database optimization on our project.

First I needed to see what the problem was, second resolve them.

So I set on a profiler in Sql Profiler. Being overmotivated I added lots of events to trace which resulted in a table with very many columns. I also did another evil thing, I set the trace to roll at 20M. This resulted in 98 trace files   .

 I tried to find some way to import them in SqlServer, but the SqlProfiler interface only allowed 1 trace file at one time to be saved as an sql table.

Well, it was hell, so I gave up importing them one by one and started to Google for a way to concatenate the SqlProfiler trace files, and here's the Golden code line :

SELECT * INTO trace_table

FROM ::fn_trace_gettable('c:\my_trace.trc', default)

You can read more about it here .

The point is there was nothing inn the above link to mention that this line achieves this as well,so the surprise was a pleasant one. 

Posted on Thursday, July 31, 2008 4:10 AM | Back to top

Comments on this post: Concatenate Sql profiler traces in a table

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © marocanu2001 | Powered by: