Numerically lists all currently active trace queue handles.
xp_trace_enumqueuehandles [queue_handle]
0 (success) or >1 (failure)
xp_trace_enumqueuehandles returns this result set if no parameters are passed.
Column name | Description |
---|---|
QueueHandle | Queue number of a currently active trace queue |
Execute permissions for xp_trace_enumqueuehandles default to members of the sysadmin fixed server role but can be granted to other users.
This example lists all currently defined trace queue handles.
Note This example assumes any trace queue handles returned were previously created by executing xp_trace_addnewqueue.
USE master
EXEC xp_trace_enumqueuehandles
Here is the result set (output may vary):
QueueHandle
-----------
2
3
4
(3 row(s) affected)
This example lists all trace queues following the trace queue specified with @queue_handle variable.
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_savequeuedefinition @queue_handle,
'London INSERTs',
0
EXEC xp_trace_enumqueuehandles @queue_handle
Here is the result set:
QueueHandle
-----------
12
(1 row(s) affected)
Monitoring with SQL Server Profiler | xp_trace_loadqueuedefinition |
xp_trace_addnewqueue | System Stored Procedures (SQL Server Profiler Extended Procedures) |
xp_trace_enumqueuedefname |