Quantcast
Channel: kristofdba – kristof dba
Viewing all articles
Browse latest Browse all 26

Check users

$
0
0

this nifty little query will show you who’s logged on and is using a lot of CPU for example, or has High IO activity etc. …
You probably know sp_who and sp_who2 , this is just a variation on those SP’s.

I found this on the net but i tweaked it for my goal : Get high IO users. I dont seem to find the original author…

Anyway, fire away !

SELECT
spid,status,sid,hostname,program_name,cmd,cpu,physical_io,blocked,dbid,
convert(sysname, rtrim(loginame)) as loginname,spid as 'spid_sort',
substring( convert(varchar,last_batch,111) ,6 ,5 ) + ' ' + substring( convert(varchar,last_batch,113) ,13 ,8 ) as 'last_batch_char',last_batch, DB_NAME(dbid)
from master.dbo.sysprocesses (nolock)
order by physical_io DESC



Viewing all articles
Browse latest Browse all 26

Trending Articles