Wednesday, March 28, 2012

question about retrieval of client process IDs

Is there any short way to make the server give out IDs of all client
processes connected to a specified DB? I guess this information must
be stored somewhere in system databases..."Alexander Korovyev" <korovyev@.rambler.ru> wrote in message
news:26c82787.0405261147.4d38ec2a@.posting.google.c om...
> Is there any short way to make the server give out IDs of all client
> processes connected to a specified DB? I guess this information must
> be stored somewhere in system databases...

Check out the sysprocesses table:

select * from master..sysprocesses
where dbid = db_id('master')

You might also want to look at @.@.SPID and sp_who in Books Online.

Simon

No comments:

Post a Comment