April 5, 2012 at 2:11 pm
Hi guys
I have 7000 user connected to DB through application. So i want to know how i can find the particular person's SPID if i have his host name .
Any Script or any ideas?
Thanks
April 5, 2012 at 2:17 pm
sure, something like this will give you all the spids that are coming from a given hostname...
if i have 8 SSMS windows open, i will have 8 spids, so it's not 1 to 1;
7000 users sounds like they might all be coming form a single application server though..hope this helps
SELECT
SPID,
KPID,
'[' + CAST(DBID AS VARCHAR(10)) + '] ' + DB_NAME(DBID) DBNAME,
PROGRAM_NAME,
HOSTNAME,
CMD,
OPEN_TRAN,
LASTWAITTYPE,
CPU,
PHYSICAL_IO,
STATUS,
LOGINAME,
NT_USERNAME,
NT_DOMAIN
FROM MASTER..SYSPROCESSES
WHERE HOSTNAME = 'DEV223'
Lowell
April 5, 2012 at 2:39 pm
As Lowell mentioned... If they are ALL accessing the db through an application server, you will not be able to delineate it. The host is the application server, not the user that is using the application.
Jared
CE - Microsoft
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply