Simple question I couldn\'t figure out (not a SQL expert... sorry): I want to do a select on the result set of sp_who2. How can I?
for ex. select SPID from [result set f
You would have to insert the results into a table, a temporary table or a table variable.
CREATE TABLE #sp_who2 (etc...) INSERT INTO #sp_who2 EXECUTE sp_who2 SELECT * FROM #sp_who2 WHERE whatever...
Another trick is using OPENROWSET