April 20, 2011 at 10:57 am
Hello all,
I have multiple databases on the same server but i need to find the user count on each database on a regular interval.
How can i achieve this using the sys.databases?
Thanks,
Vincent
April 20, 2011 at 11:23 am
This should get you what you need.
select DB_NAME(database_id) as DBName, COUNT(database_id) as NumConnections
From sys.dm_exec_requests
Group by DB_NAME(database_id)
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy