DMV : sys.dm_exec_connections

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

Column name Data type Description
session_id int Identifies the session associated with this connection. Is nullable.
connect_time datetime Timestamp when connection was established. Is not nullable.
num_reads int Number of packet reads that have occurred over this connection. Is nullable.
num_writes int Number of data packet writes that have occurred over this connection. Is nullable.
last_read datetime Timestamp when last read occurred over this connection. Is nullable.
last_write datetime Timestamp when last write occurred over this connection. Not Is nullable.
client_net_address varchar(48) Host address of the client connecting to this server. Is nullable.

sys.dm_exec_connections

–Client wich has more than one connection

SELECT  client_net_address ,COUNT(*) number_of_connections

FROMsys.dm_exec_connections

GROUP BY client_net_address

HAVING  COUNT(*)> 1

ORDER  BY number_of_connections desc

–Oldest connection to server

SELECT  session_id,connection_id,connect_time FROMsys.dm_exec_connections

ORDER  BY connect_time asc

–Connection with highest network utilization

SELECT  num_reads,num_writes FROMsys.dm_exec_connections

ORDER  BY num_reads DESC,num_writes DESC

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s