Share via


fn_trace_getinfo (Transact-SQL)

Returns information about a specified trace or all existing traces.

Topic link iconTransact-SQL Syntax Conventions

Syntax

fn_trace_getinfo ( trace_id )

Arguments

  • trace_id
    Is the ID of the trace. trace_id is int.

Tables Returned

Column name Data type Description

traceId

int

ID of the trace.

property

int

Property of the trace:

1= Trace options. For more information, see @options in sp_trace_create (Transact-SQL).

2 = File name

3 = Max size

4 = Stop time

5 = Current trace status

value

sql_variant

Information about the property of the trace specified.

Remarks

When passed the ID of a specific trace, fn_trace_getinfo returns information about that trace. When passed a 0, NULL, or the string 'default', this function returns information about all active traces. When passed an invalid ID, this function returns an empty rowset.

fn_trace_getinfo appends a .trc extension to the name of any trace file included in its result set. For information on defining a trace, see sp_trace_create (Transact-SQL).

Permissions

Requires ALTER TRACE permission on the server.

See Also

Reference

sp_trace_create (Transact-SQL)
sp_trace_generateevent (Transact-SQL)
sp_trace_setevent (Transact-SQL)
sp_trace_setfilter (Transact-SQL)
sp_trace_setstatus (Transact-SQL)

Help and Information

Getting SQL Server 2005 Assistance

Change History

Release History

17 July 2006

New content:
  • Added text about the trace file name extension.