How to filter or group the data in a trace file

Posted on 2013-10-02
Medium Priority
Last Modified: 2013-10-02
I've created some traces to files (not SQL tables) using SQL Server Profiler.  I can open the files with SQL Server Profiler, but I'd like to filter and group the entries so I can see which application is responsible for all the SQL activity.

But I don't see any ability in SQL Server Profiler to manipulate the data in a trace, if the trace was recorded to a file.  I can export the data to an SQL file, but that doesn't seem useful either.

There must be a way to manipulate the data in a trace recorded to a file.

Any ideas?

Thanks in advance.
Question by:dakota5
LVL 18

Accepted Solution

x-men earned 2000 total points
ID: 39539694
use the fn_trace_gettable function:
Returns the content of one or more trace files in tabular form.
fn_trace_gettable ( 'filename' , number_files )

more at: http://technet.microsoft.com/en-us/library/ms188425.aspx

FROM fn_trace_gettable('c:\temp\mytrace.trc', default)
WHERE <...>

Author Closing Comment

ID: 39540199
OK.  Or select it into an SQL table.  So you can't do much with the data while it is still in the .trc file.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
SQL Database Recovery Software repairs the MDF & NDF Files, corrupted due to hardware related issues or software related errors. Provides preview of recovered database objects and allows saving in either MSSQL, CSV, HTML or XLS format. Ensures recov…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

588 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question