the stored proc sp_who or sp_who2 give you that information - run it against the master database.
It pulls information from the sysprocesses table, and if you take a look at the code for the stored proc you'll see exactly how they do that.
cheers
AB
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.