xp_trace_deletequeuedefinition (T-SQL)

Deletes the named trace queue from the registry.

Syntax

xp_trace_deletequeuedefinition {'queue_name', is_shared}

Arguments
'queue_name'
Is a string specifying the trace queue name. This name can be determined by executing xp_trace_enumqueuedefname.
is_shared
Is a Boolean value specifying whether the trace queue definition is shared (1) or private (0).
Return Code Values

0 (success) or >1 (failure)

Result Sets

xp_trace_deletequeuedefinition returns this message:

The command(s) completed successfully.

  

Permissions

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

Examples

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

  

See Also
Monitoring with SQL Server Profiler xp_trace_savequeuedefinition
xp_trace_destroyqueue System Stored Procedures (SQL Server Profiler Extended Procedures)

  


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