Jasinski Technical Wiki

Navigation

Home Page
Index
All Pages

Quick Search
»
Advanced Search »

Contributor Links

Create a new Page
Administration
File Management
Login/Logout
Your Profile

Other Wiki Sections

Software

PoweredBy

SP_WHO Filtering - SQL Server

RSS
Modified on Fri, Mar 01, 2019, 6:22 AM by Administrator Categorized as SQL Server
if object_id('tempdb..#spwho') is not null drop table #spwho

create table #spwho (
     spid       int not null
    ,ecid       int not null
    ,status     varchar(10) not null
    ,loginame   nvarchar(300) not null
    ,hostname   nvarchar(300) not null
    ,blk        int not null
    ,dbname     nvarchar(300) null
    ,cmd        nvarchar(1000) not null
    ,request_id int not null
)

insert into #spwho
exec sp_who

select * 
from #spwho
where blk <> 0

ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.