SP_Who3
Copied Source: http://sqlserverplanet.com/dba/a-better-sp_who2-using-dmvs-sp_who3 The following code generates the same information found in sp_who2, along with some additional troubleshooting information. It also contains the SQL Statement being run, so instead of having to execute a separate DBCC INPUTBUFFER, the statement being executed is shown in the results. Unlike sp_who2, this custom sp_who3 only shows sessions that have a current executing request. What is also shown is the reads and writes for the current command, along with the number of reads and writes for the entire SPID. It also shows the protocol being used (TCP, NamedPipes, or Shared Memory). The lead blocker below will show in the BlkBy column as -1. CREATE PROCEDURE [ dbo ] . [ sp_who3 ] AS BEGIN SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED SELECT SPID = er . session_id ...