Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

sql: extract statement & duration from large trace file

Avatar of sfun28
sfun28 asked on
Microsoft SQL Server 2005Microsoft SQL Server 2008
13 Comments1 Solution455 ViewsLast Modified:
Folks, I used Sql Server Profiler and let it run for a while.  I now have a fairly large (8GB) trace file.  I'm only interested in getting the SQL statements besides the duration for Sql:BatchCompleted events.  This can either be in the form of a table or exported to Excel.  Basically I want to sort on Duration and see which queries are taking the longest.  So ideal format is:
Sql Statment, Duration

Is there a way to do this without importing the whole trace file?  Could you provide specific instructions on how to accomplish this?