1 2 3 |
SELECT spid, status, loginame, hostname, blocked, DB_NAME(dbid) AS database_name, cmd FROM master..sysprocesses WHERE DB_NAME(dbid) = 'your_db_name' |
This is best run under a administrative user such as 'sa' if you want to display all users, otherwise only users you are allowed to see will be shown.