fn_trace_getinfo

Transact-SQL Reference

Transact-SQL Reference

fn_trace_getinfo

Returns information about a specified trace or existing traces.

Syntax

fn_trace_getinfo( [ @traceid = ] trace_id )

Arguments

[ @traceid = ] trace_id

Is the ID of the trace, and is an integer. To return information on all traces, specify the default value for this parameter. The keyword 'default' must be used, as in

SELECT * FROM :: fn_trace_getinfo(default) 

When the value of 0 is explicitly supplied, the function will return all traces as if the function was called with the 'default' keyword. The user employs this trace_id value to identify, modify, and control the trace.

Tables Returned

If a trace_id is specified, fn_trace_getinfo returns a table with information about the specified trace. If no trace_id is specified, this function returns information about all active traces.

Column name Data type Description
TraceId int The ID of the trace.
Property int The property of the trace as represented by the following integers:

1 - Trace Options (See @options in sp_trace_create)
2 - FileName
3 - MaxSize
4 - StopTime
5 - Current Trace status

Value sql_variant The information about the property of the trace specified.

Remarks

fn_trace_getinfo is a Microsoft® SQL Server™ 2000 built-in function that performs many of the actions previously executed by extended stored procedures available in earlier versions of SQL Server. Use fn_trace_getinfo instead of:

  • xp_trace_getqueuecreateinfo

  • xp_trace_getqueuedestination

  • xp_trace_getqueueproperties

To obtain information previously returned by the xp_trace_getqueueproperties, for example, execute a query in the following form:

SELECT *
FROM ::fn_trace_getinfo(trace_id)
WHERE Property=4

See Also

sp_trace_generateevent

sp_trace_setevent

sp_trace_setfilter

sp_trace_setstatus