This command prints out the contents of the DBTABLE structure.

Syntax:

DBCC DBTABLE ({dbid|dbname})

where
dbid|dbname - database name or database ID

This is the example:

DBCC TRACEON (3604)
DBCC DBTABLE (master)

The DBTABLE structure has an output parameter called dbt_open.
This parameter keeps track of how many users are in the database.