xp_trace_seteventclassrequired (T-SQL)

Specifies the event classes to trace or not to trace for the specified trace queue.

Syntax

xp_trace_seteventclassrequired {queue_handle, event_class,
    
isrequired}

Arguments
queue_handle
Is an integer representing the handle for the trace queue. queue_handle is used to reference the trace queue and is placed in an output parameter by xp_trace_addnewqueue.
event_class
Is an integer representing the class of events to capture.
isrequired
Is a Boolean value indicating whether event_class is included (1) or is not included (0) in trace results.
Return Code Values

0 (success) or >1 (failure)

Result Sets

xp_trace_seteventclassrequired returns this message:

The command(s) completed successfully.

  

Remarks

Generate the event class list by executing xp_trace_geteventnames.

Permissions

Execute permissions for xp_trace_seteventclassrequired default to members of the sysadmin fixed server role but can be granted to other users.

Examples

This example sets the trace queue to trace all attention events (event class value of 16).

USE master

DECLARE @queue_handle int, @column_value int

SET @column_value = 16|32|8192|128|512

EXEC xp_trace_addnewqueue 1000,

    5,

    95,

    90,

    @column_value,

    @queue_handle OUTPUT

EXEC xp_trace_seteventclassrequired @queue_handle,

    16,

    1

  

See Also
Monitoring with SQL Server Profiler xp_trace_geteventnames
xp_trace_addnewqueue System Stored Procedures (SQL Server Profiler Extended Procedures)
xp_trace_eventclassrequired  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.