Created
November 11, 2019 12:19
-
-
Save JohnLBevan/c6b49f11b87ed04d49ffb1b9be39f4a2 to your computer and use it in GitHub Desktop.
SP_WHO2 Wrapper; to make filtering SP_WHO2's simple
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare @sp_who2 table ( | |
Spid int | |
,[Status] varchar(255) | |
,[Login] varchar(255) | |
,HostName varchar(255) | |
,BlkBy varchar(255) | |
,DBName varchar(255) | |
,Command varchar(255) | |
,CpuTime int | |
,DiskIo int | |
,LastBatch varchar(255) | |
,ProgramName varchar(255) | |
,Spid2 int | |
,RequestId int | |
) | |
insert into @sp_who2 exec sp_who2 | |
select * from @sp_who2 where DbName = 'dbname' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment