I\'ve looked at other questions on Stack Overflow related to this question, but none of them seemed to answer this question clearly.
We have a system Stored Procedure ca
The filtering of temporary table is the possible way.
-- Create tmp table from sp_who results
CREATE TABLE #TmpWho
(spid INT, ecid INT, status VARCHAR(150), loginame VARCHAR(150),
hostname VARCHAR(150), blk INT, dbname VARCHAR(150), cmd VARCHAR(150), request_id INT)
INSERT INTO #TmpWho
EXEC sp_who
-- filter temp table where spid is 52
SELECT * FROM #TmpWho
WHERE spid = 52
DROP TABLE #TmpWho