xp_trace_savequeuedefinition (T-SQL)

Specifies the trace queue definition to save.

Syntax

xp_trace_savequeuedefinition {queue_handle, 'queue_name', is_shared}

Arguments
queue_handle
Is an integer representing the handle for the trace queue. queue_handle is used to reference the trace queue and is placed in an output parameter by xp_trace_addnewqueue.
'queue_name'
Is a string specifying the name under which the trace queue is saved.
is_shared
Is a Boolean value specifying whether a trace queue definition is private (0) or shared (1).
Return Code Values

0 (success) or >1 (failure)

Result Sets

xp_trace_savequeuedefinition returns this message:

The command(s) completed successfully.

  

Remarks

If you choose to save a queue definition as a private definition, it is only available to you. If you choose to save a queue definition as a shared definition, it is available to anyone who logs on to that particular computer.

Permissions

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

Examples

This example saves the trace queue definition for the Seattle SQL Batch Starting and Completing trace queue as a private trace queue definition.

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 SQL Batch Starting and Completing',

    0

  

See Also
Monitoring with SQL Server Profiler xp_trace_getqueueautostart
xp_trace_addnewqueue xp_trace_loadqueuedefinition
xp_trace_deletequeuedefinition xp_trace_pausequeue
xp_trace_destroyqueue xp_trace_restartqueue
xp_trace_enumqueuedefname xp_trace_setqueueautostart
xp_trace_enumqueuehandles System Stored Procedures (SQL Server Profiler Extended Procedures)

  


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