From: r14edge on
Hi,

I'm looking for a way to monitor the number of simultaneous connections
during a day. Is that possible? If yes, how is it possible?

Thank you

Fred
From: jgurgul on
Hi Fred

It depends really what you mean by a connection as to which view you need to
look at, but simple answer is yes.

Is it something that is simple connected to the sql server? or something
that is running a piece of sql etc. (active connections versus idle etc)

All this information is available from management views, you would just need
to collect it periodically and take the maxiumum number in any given time
slot.


SELECT * FROM sys.dm_exec_connections
http://msdn.microsoft.com/en-us/library/ms181509.aspx

Returns information about the connections established to this instance of
SQL Server and the details of each connection.


SELECT * FROM dm_exec_sessions
http://msdn.microsoft.com/en-us/library/ms176013.aspx

Returns one row per authenticated session on SQL Server.
sys.dm_exec_sessions is a server-scope view that shows information about all
active user connections and internal tasks. This information includes client
version, client program name, client login time, login user, current session
setting, and more. Use sys.dm_exec_sessions to first view the current system
load and to identify a session of interest, and then learn more information
about that session by using other dynamic management views or dynamic
management functions.


SELECT * FROM sys.dm_exec_requests
http://msdn.microsoft.com/en-us/library/ms177648.aspx

To execute code that is outside SQL Server (for example, extended stored
procedures and distributed queries), a thread has to execute outside the
control of the non-preemptive scheduler. To do this, a worker switches to
preemptive mode. Time values returned by this dynamic management view do not
include time spent in preemptive mode.

Cheers

Jon

"r14edge" wrote:

> Hi,
>
> I'm looking for a way to monitor the number of simultaneous connections
> during a day. Is that possible? If yes, how is it possible?
>
> Thank you
>
> Fred