hi,
i think u could use this queries...
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
Sunil