Link to home
Start Free TrialLog in
Avatar of Minesh Shah
Minesh ShahFlag for India

asked on

Concurrent connected user in SharePoint Site and Database

Hi, I have 150+ Site Collection in SharePoint and each site collections having their own databases.
My query Is, How to find out total number and name of concurrent connected users in each SharePoint site collection?
I want both the ways means via SharePoint Site collection and via each database.
Is there any query to run on database or any code need to write for sites?
I am using SharePoint 2007 and SQL Server 2005.
Is it possible to get total number of users connected on SQL Server?
Kindly help.
Avatar of lkammer
lkammer
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi,

You can select a count of the number of connected users to each database within an instance of SQL Server using something like this.

select count(distinct loginame), DB_NAME(dbid) from master..sysprocesses
Group by DB_NAME(dbid)
Having db_name(dbid) not in ('master', 'msdb')
order by db_name(dbid)

Open in new window


To obtain a list of usernames and the database(s) they are connected to

select loginame, DB_NAME(dbid) from master..sysprocesses
Group by loginame, DB_NAME(dbid)
Having db_name(dbid) not in ('master', 'msdb')
order by db_name(dbid)

Open in new window


Hope this helps.

Cheers

Leon
Avatar of Minesh Shah

ASKER

Sorry, what I want in result above queries are not giving those results.
I think it’s showing the Id by which the SQL Server is authenticated, means admin id.
I want user’s id’s that are login currently in sites.
Kindly help
ASKER CERTIFIED SOLUTION
Avatar of lkammer
lkammer
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok