Store output of sp_who2 in a table I am looking for something like this, where I could store the output of sp_who2 in a table, without having to first create the table:

create table test as exec sp_who2
USE yourDb;

CREATE TABLE temp_sp_who2
    (
      SPID INT,
      Status VARCHAR(1000) NULL,
      Login SYSNAME NULL,
      HostName SYSNAME NULL,
      BlkBy SYSNAME NULL,
      DBName SYSNAME NULL,
      Command VARCHAR(1000) NULL,
      CPUTime INT NULL,
      DiskIO BIGINT NULL, -- int
      LastBatch VARCHAR(1000) NULL,
      ProgramName VARCHAR(1000) NULL,
      SPID2 INT
      , RequestId INT NULL --comment out for SQL 2000 databases
 
    )
 
 
INSERT  INTO temp_sp_who2
EXEC sp_who2
 
SELECT  *
FROM    temp_sp_who2
WHERE   DBName = 'yourDb'

Link
Just tested it on SQL server 2012