Deletes the named trace queue from the registry.
xp_trace_deletequeuedefinition {'queue_name', is_shared}
0 (success) or >1 (failure)
xp_trace_deletequeuedefinition returns this message:
The command(s) completed successfully.
Execute permissions for xp_trace_deletequeuedefinition default to members of the sysadmin fixed server role but can be granted to other users.
This example deletes the trace queues named Seattle SELECTs and UPDATEs, which is stored as a private trace queue definition. In order to perform the deletion of the trace queue, it is necessary for the trace to be a saved trace (executed by xp_trace_savequeuedefinition).
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,
'Seattle SELECTs and UPDATEs',
0
EXEC xp_trace_deletequeuedefinition 'Seattle SELECTs and UPDATEs',
0
Monitoring with SQL Server Profiler | xp_trace_savequeuedefinition |
xp_trace_destroyqueue | System Stored Procedures (SQL Server Profiler Extended Procedures) |