How can I see who is connected to my db?

If I recall correctly in 2005 you can type this in a new query and then execute it:

exec sp_who
go

it will probably work in 2008.

Yes, it will: http://msdn.microsoft.com/en-us/library/ms174313.aspx


You can use the Activity Monitor in SQL Server Management Studio. Once it's open look at the Processes section to see what is running, the login, database being used, and other helpful information.


I think to check number of active connections and their Databases, please use:

SELECT DB_NAME(dbid) as DBName, COUNT(dbid) as 'Number Of Connections',
    loginame as LoginName
FROM sys.sysprocesses
WHERE dbid > 0
GROUP BY dbid, loginame