this is for a server
select distinct sysl.name from master..sysprocesses sysp,master..syslogins sysl
where sysp.sid= sysl.sid
this is for a DB.
select distinct sysl.name from master..sysprocesses sysp,master..syslogins sysl, sysdatabases sysd
where sysp.sid= sysl.sid and sysd.dbid = sysp.dbid and sysd.dbid = 7
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.