Databases Reference
In-Depth Information
Figure 5-29
ImportingTraceDatatoaTraceTable
The SQL Server function fn_trace_gettable returns the content of one or more trace files in tabular
form. Use this function to read trace files directly and insert data into a user database table
for analysis.
SELECT *
INTO temp_trace_table_001
FROM ::fn_trace_gettable('c: \ temp \ myServerSideTraceOutput_CostlyQueries
.trc', default)
The function fn_trace_gettable returns a table specified with the columns valid for the specified trace.
The function fn_trace_gettable has two arguments. The first argument, filename ,specifiesthe
initial trace file to be read. The second argument, number_files ,specifiesthenumberofrolloverfilesto
be read; this number includes the initial file specified in filename .If number_files is specified as default,
fn_trace_gettable will read all the rollover files until it reaches the end of the trace.
One minor issue that will need to be resolved is that the data type of the TextData column created
by the function is a SQL NTEXT data type. Many string functions do not support the NTEXT
data type.
Search WWH ::




Custom Search