xp_trace_loadqueuedefinition (T-SQL)

Loads a saved trace queue definition stored in the registry, which is configured by executing xp_trace_savequeuedefinition and associated with the specified trace queue. A trace queue definition is all of the information that makes up a trace queue including the name, the data to trace for the trace queue, and any configured filters.

Syntax

xp_trace_loadqueuedefinition {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 trace queue name. queue_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_loadqueuedefinition returns this message:

The command(s) completed successfully.

  

Remarks

A trace queue handle must be created by using xp_trace_addnewqueue before calling xp_trace_loadqueuedefinition.

The trace queue definition information, configured and saved by using xp_trace_savequeuedefinition, is used by the specified trace queue to determine the events, data, and filters that will be applied.

Permissions

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

Examples

This example loads a shared trace queue definition for the trace queue. Because xp_trace_loadqueuedefinition requires a previously saved trace queue definition, xp_trace_savequeuedefinition is executed before xp_trace_loadqueuedefinition.

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',

    1

EXEC xp_trace_loadqueuedefinition @queue_handle,

    'Seattle SQL Batch Starting and Completing',

    1

  

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

  


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