Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the # of users

Status
Not open for further replies.
Jul 23, 2007
15
0
0
US
I'm kind of new to working with SQL. I can install and setup maintenance. I have setup users and groups to have access. Yesterday, my boss asked that I find out how many users we have per database. From what I understand, he wants to know how many people actually use the databases. Is there a SQL query command I can run to find this out? I have no clue and google has not been my friend. Any help would be appreciated. :)
 
Run sp_who or sp_who2 from a query window. It will show you all active sessions.


- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Another option you have is to enable logging for All logins.

Run that for 24 hours, dump that log to a physical table. Then query the table, extracting all the unique user names. Seems like a lot of work, but it is possible. This would give you a very accurate number for your boss.

HTH John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top