xp_trace_enumqueuedefname (T-SQL)

Alphabetically lists all currently defined trace queue names.

Syntax

xp_trace_enumqueuedefname {is_shared} [, 'queue_name']

Arguments
is_shared
Is a Boolean value specifying whether to enumerate the shared (1) or private (0) trace queue definition(s).
'queue_name'
Is the trace queue name from which to begin the alphabetically ascending trace queue name list. If queue_name is specified, queue_name and those queue names that follow it in alphabetic order are listed. If queue_name is not specified, all currently defined trace queue names are returned.
Return Code Values

0 (success) or >1 (failure)

Result Sets
Column name Description
QueueDefinitionName Name of a currently defined trace queue

Permissions

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

Examples
A. Return all currently defined, shared trace queue names

This example retrieves all currently defined and shared queue names.

USE master

EXEC xp_trace_enumqueuedefname 1

  

Here is the result set (output may vary):

QueueDefinitionName                                                   

-----------------------------------------------------------------------

DemoQueue

London Attention

London Events

Seattle SQL Batch Starting and Completing

  

(4 row(s) affected)

  

B. Return all trace queue names after a specified name

This example retrieves all currently defined and shared definition trace queue names, in alphabetic order, that follow the London Events trace queue name.

USE master

EXEC xp_trace_enumqueuedefname 1,

    'London Events'

  

Here is the result set (output may vary):

QueueDefinitionName                                                   

-----------------------------------------------------------------------

London Events

Seattle SQL Batch Starting and Completing

  

(2 row(s) affected)

  

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

  


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