Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
PABluesMan
Starting Member
26 Posts |
Posted - 2008-03-25 : 16:01:41
|
Here's a quick script to filter the system SPIDs out of the result set from sp_who2. Enjoy!/*********************************************************************************************************/CREATE TABLE #Who ( SPID INT, Status VARCHAR (128), Login VARCHAR (256), HostName VARCHAR (128), BlkBy VARCHAR (8), DBName VARCHAR (128), Command VARCHAR (128), CPUTime INT, DiskIO INT, LastBatch VARCHAR (32), ProgramName VARCHAR (1024), SPID2 INT, RequestID INT )INSERT #WhoEXEC sp_who2SELECT *FROM #WhoWHERE SPID > 50order by loginDROP TABLE #Who/*********************************************************************************************************/I geek, therefore I am |
|
|
|
|