question

indra.velpu avatar image
indra.velpu asked

Count of connections that have occurred on a SQL Server database

Hi I am looking for the connection counts on a particular database from day 1 of that database's creation.
sql server 2008monitoring
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JohnM avatar image
JohnM answered
If you don't have some type of monitoring in place (audits, extended events, trace, etc) already running, as far as I know, you won't be able to locate that information. If the server has never been rebooted since the database was created, you can probably use sys.dm_exec_sessions to aggregate the number of sessions to a particular database for a point in time. This won't give you the total count over time since sessions will come and go, but it might be a start. SELECT DB_NAME(database_id), COUNT(1) AS 'Session Count' FROM sys.dm_exec_sessions WHERE DB_NAME(database_id) = 'DatabaseNameHere' GROUP BY DB_NAME(database_ID) Hope that helps!
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

indra.velpu avatar image indra.velpu commented ·
Thank you for Your Time John :-). I am looking for the connections on particular database from day 1 of its creation.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.