Skip to content

Instantly share code, notes, and snippets.

@nkundu
Last active June 2, 2017 17:01
Show Gist options
  • Save nkundu/f8ca6424c780b5eba3109ea54928ef4b to your computer and use it in GitHub Desktop.
Save nkundu/f8ca6424c780b5eba3109ea54928ef4b to your computer and use it in GitHub Desktop.
create table #tmpSpWho2 (
SPID bigint
, [Status] nvarchar(100)
, [Login] nvarchar(100)
, HostName nvarchar(100)
, BlkBy nvarchar(100)
, DBName nvarchar(100)
, Command nvarchar(100)
, CPUTime bigint
, DiskIO bigint
, LastBatch nvarchar(50)
, ProgramName nvarchar(100)
, SPID2 bigint
, REQUESTID int)
insert into #tmpSpWho2
exec sp_who2
select * from #tmpSpWho2 where ...
drop table #tmpSpWho2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment