How to Select from a Stored Procedure – SQL Server
How to treat a stored procedure that ends with a select as a select in another query:
You have to create a schema-compatible temp table, but then you can do filtering and grouping when you select out of the temp table at the end.
create table #sp_who (
spid smallint,
ecid smallint,
status nchar(30),
loginame nchar(128),
hostname nchar(128),
blk char(5),
dbname nchar(128),
cmd nchar(16))
insert into #sp_who execute sp_who
select * from #sp_who
drop table #sp_who