Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Calculating Concurrent Users in a Database?

$
0
0
I am researching this and playing with using the syss.sysprocesses view and counting the dbid column. I would most likely want to store this information in a table with a date/time stamp because we really want to track our concurrent users during the day for awhile. Do you have any neat tricks in getting this done? Is there a DMV or Information_Schema view that could be used to accomplish this task? I found the following code on the internet:SELECT DB_NAME(dbid) AS DBName, COUNT(dbid) AS NumberOfConnections, loginame AS LoginName, nt_domain AS NT_Domain, nt_username AS NT_UserName, hostname AS HostNameFROM sys.sysprocessesWHERE dbid > 0GROUP BY dbid, hostname, loginame, nt_domain, nt_usernameORDER BY NumberOfConnections DESC;Thanks in advance, Kevin

Viewing all articles
Browse latest Browse all 3145

Trending Articles