sys.fn_trace_getfilterinfo (Transact-SQL)
Collapse the table of content
Expand the table of content

sys.fn_trace_getfilterinfo (Transact-SQL)

 

Updated: June 10, 2016

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Returns information about the filters applied to a specified trace.

System_CAPS_ICON_important.jpg Important


This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Use Extended Events instead.

Topic link icon Transact-SQL Syntax Conventions

  
fn_trace_getfilterinfo ( trace_id )  

trace_id
Is the ID of the trace. trace_id is int, with no default.

Returns the following information. For more information about the columns, see sp_trace_setfilter (Transact-SQL).

Column nameData typeDescription
columnidintThe ID of the column on which the filter is applied.
logical_operatorintSpecifies whether the AND or OR operator is applied.
comparison_operatorintSpecifies the type of comparison made:

0 = Equal

1 = Not equal

2 = Greater than

3 = Less than

4 = Greater than or equal

5 = Less than or equal

6 = Like

7 = Not like
valuesql_variantSpecifies the value on which the filter is applied.

The user sets trace_id value to identify, modify, and control the trace. When passed the ID of a specific trace, fn_trace_getfilterinfo returns information about any filter on that trace. If the specified trace does not have a filter, this function returns an empty rowset. When passed an invalid ID, this function returns an empty rowset. For similar information about traces, see sys.fn_trace_getinfo (Transact-SQL).

Requires ALTER TRACE permission on the server.

The following example returns information about all filters on trace number 2.

SELECT * FROM fn_trace_getfilterinfo(2) ;  
GO  
  

Create a Trace (Transact-SQL)
sp_trace_setfilter (Transact-SQL)
sp_trace_create (Transact-SQL)
sp_trace_generateevent (Transact-SQL)
sp_trace_setevent (Transact-SQL)
sp_trace_setstatus (Transact-SQL)
sys.fn_trace_geteventinfo (Transact-SQL)
sys.fn_trace_getinfo (Transact-SQL)
sys.fn_trace_gettable (Transact-SQL)

Community Additions

ADD
Show:
© 2016 Microsoft