xp_trace_setspidfilter (T-SQL)

Specifies the system process identification number (SPID) filter to include for the events specified. Microsoft® SQL Server™ captures the required information, configured by executing xp_trace_seteventclassrequired, for the specified SPID.

Syntax

xp_trace_setspidfilter {queue_handle, spid}

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.
spid
Is an integer specifying the SPID for the events to capture. Execute sp_who to determine valid SPIDs.
Return Code Values

0 (success) or >1 (failure)

Result Sets

xp_trace_setspidfilter returns this message:

The command(s) completed successfully.

  

Permissions

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

Examples

This example configures the SPID filter value information for the trace queue. A SPID of 41 is supplied.

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_setspidfilter @queue_handle,

    41

  

See Also
Monitoring with SQL Server Profiler xp_trace_getqueueproperties
sp_who xp_trace_getspidfilter
xp_trace_addnewqueue System Stored Procedures (SQL Server Profiler Extended Procedures)
xp_trace_enumqueuehandles  

  


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