views:

274

answers:

1

I have a set of rollover .trc files recorded with Sql Profiler.

mytrace.trc

mytrace_1.trc

mytrace_2.trc

mytrace_3.trc

I can import the first one using this command:

use [my-database]
SELECT * INTO trace_folder
FROM::fn_trace_gettable('C:\mytrace.trc', 4)

However, this only appears to load the first file, not all four.

+1  A: 

You'll want to use fn_trace_gettable:

From http://msdn.microsoft.com/en-us/library/ms188425.aspx:

USE AdventureWorks;
GO
SELECT * INTO temp_trc
FROM fn_trace_gettable('c:\temp\mytrace.trc', default);
GO
Paul Kearney - pk
updated my question for clarity -- I am interested in multiple rollover .trc files
frankadelic
Passing "default" as the second parameter should load all trace files sequentially, unless the initial tracefile name ends with an underscore and a number (which in your example, it does not).Not sure why you are not getting them all loaded. Are they all in the same folder?
Paul Kearney - pk
ah, that was the issue. (my original files were actually named mytrace_20100420.trc etc...) Thanks!
frankadelic