Ramkumar Kamaraj
Ramkumar Kamaraj

Reputation: 31

Compare two SQL Server Profiler traces

I want to compare two SQL Server profiler traces, any tool does this?

Thanks, Ramkumar

Upvotes: 3

Views: 3463

Answers (6)

Steven Ensslen
Steven Ensslen

Reputation: 1376

@Narnian is correct, comparing the traces in a database is usually easiest. If your traces were captured into files, you can use fn_trace_gettable to read those files into a database.

Do note that I said, a database. You're rarely going to want to load them into the same database that you profiled. Typically I use a different instance.

Upvotes: 0

John Zabroski
John Zabroski

Reputation: 2349

Most answers are about comparing, literally, two trace files.

However, I think the OP was asking how to determine if a change in code or hardware improved/degraded performance.

In that case:

Upvotes: 0

Danny Klingseisen
Danny Klingseisen

Reputation: 1

The first part of Wilco's answer is good (In the profiler you can export the trace files by using File | Export | Extract SQL Server Events | Extract Transact-SQL Events) and I do use Notepad++ from time to time to compare, however using Winmerge is very easy. Install the little component: http://winmerge.org/?lang=en Find the two files you want to compare with Winmerge installed, highlight them, right-click and choose "Winmerge", will then open the editor in compare mode.

Upvotes: 0

Wilco
Wilco

Reputation: 41

In the profiler you can export the trace files by using File | Export | Extract SQL Server Events | Extract Transact-SQL Events. When you do this for both traces, you can compare them for instance with Notepad++ (compare plugin).

Upvotes: 4

Mattl
Mattl

Reputation: 1618

Save them to a text file and use a file comparison tool like Beyond Compare?

Upvotes: 0

Narnian
Narnian

Reputation: 3908

There is an option to write your results to a database table. If you do that, then you can write queries to compare the aggregate results of both. This would be meaningful, provided that both runs occur at the same time of day and go for the same duration.

I've recently blogged about how to use SQL Profiler to optimize databases.

A Beginner's Guide to SQL Server Database Optimization

Upvotes: 0

Related Questions