Home Forums SQL Server 2005 Administering Command to know no of users connected to particular database? RE: Command to know no of users connected to particular database?

  • Here is the query you are looking for

    SELECT DB_NAME(dbid) as 'Database Name',

    COUNT(dbid) as 'Total Connections'

    FROM master.dbo.sysprocesses WITH (nolock)

    WHERE dbid > 0

    GROUP BY dbid