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.
xp_trace_loadqueuedefinition {queue_handle, 'queue_name', is_shared}
0 (success) or >1 (failure)
xp_trace_loadqueuedefinition returns this message:
The command(s) completed successfully.
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.
Execute permissions for xp_trace_loadqueuedefinition default to members of the sysadmin fixed server role but can be granted to other users.
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