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