Specifies the event classes to trace or not to trace for the specified trace queue.
xp_trace_seteventclassrequired {queue_handle, event_class,
isrequired}
0 (success) or >1 (failure)
xp_trace_seteventclassrequired returns this message:
The command(s) completed successfully.
Generate the event class list by executing xp_trace_geteventnames.
Execute permissions for xp_trace_seteventclassrequired default to members of the sysadmin fixed server role but can be granted to other users.
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
Monitoring with SQL Server Profiler | xp_trace_geteventnames |
xp_trace_addnewqueue | System Stored Procedures (SQL Server Profiler Extended Procedures) |
xp_trace_eventclassrequired |