6

I am trying to diagnose an issue with a production SQL Server instance. I have asked the DBA to provide a trace and have been given a set of SQL trace files (1185 files to be precise).

When I open the first file, SQL Profiler detects presence of additional trace files and prompts me to load the one by one - this approach does not scale to 1185 files.

Ultimately, what I want is to import all that trace data into SQL server so I can query it.

Can you recommend an approach or tool that would allow me to do this?

1
  • 1
    do you have dev sql server instances?
    – swasheck
    Nov 16, 2012 at 17:43

2 Answers 2

3

Laerte Junior has a nice article on how to read these using Powershell. Go down to the "Reading Multiple Trace Files and Insert into SQL table." section for the exact statement.

5

The following will insert the entire set of files into a table of your choosing. Then you can query. Please do this on a dev instance.

SELECT * 
INTO [Database].[schema].[table] 
FROM ::fn_trace_gettable('\path\to\tracefile1.trc', default)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.