posted 3/21/2010 by indupriya - Views: [73499]
There are three ways to find who is connected to a database in sqlserver.
First one:
Second One:
Third One:
select spid, status, loginame, hostname, blocked, db_name(dbid), cmd from master..sysprocesses where db_name(dbid) = 'databasename'
This gives the status, login name and host name for the database you specify.