[SQL Snippet]Query Connection Information

Okay I’m trying to improve my sql skills so I’ve opened up today a new category called SQL there I will try to post various stuff of course useful stuff ūüėČ

This is my first snippet for you guys this snippet show’s you the time when a connection has been established from which Inet or Local IP address.

SELECT  CONVERT(DATETIME, connect_time, 1) AS [Connection Time] ,        client_net_address AS [Client Internet Address] ,        local_net_address AS [Local IP Address]FROM    sys.dm_exec_connectionsORDER BY [Connection Time] DESC

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s