locked
SQL hostname and client_net_address and in sysprocesses, dm_exec_connections RRS feed

  • Question

  • Hi,

    I have a tsql script as:

    SELECT DB_NAME(dbid) as DBName, 
        COUNT(dbid) as NumberOfConnections,
        loginame as LoginName, hostname ,
            net_library, net_address, client_net_address
    FROM     sys.sysprocesses S 
    INNER JOIN    sys.dm_exec_connections AS decc 
    ON S.spid = decc.session_id
    WHERE     hostname='F00'
    GROUP BY     dbid, loginame,hostname,  
    net_library,  net_address, client_net_address


    I'm wondering why there're many connections sharing the the same hostname 'F00' but with different client_net_addresses.

    Thanks for help.

    Jason


    Tuesday, February 16, 2016 7:18 AM

Answers

All replies

  • Jason

    Can two Windows computers in the same network have the same name? Yes and no. If the computers are domain joined the answer is no. If they aren't domain joined then the answer is yes, but problems would ensue.


    Best Regards,Uri Dimant SQL Server MVP, http://sqlblog.com/blogs/uri_dimant/

    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting: Large scale of database and data cleansing
    Remote DBA Services: Improves MS SQL Database Performance
    SQL Server Integration Services: Business Intelligence

    Tuesday, February 16, 2016 8:04 AM
    Answerer
  • Hi,

    I have a tsql script as:

    SELECT DB_NAME(dbid) as DBName, 
        COUNT(dbid) as NumberOfConnections,
        loginame as LoginName, hostname ,
            net_library, net_address, client_net_address
    FROM     sys.sysprocesses S 
    INNER JOIN    sys.dm_exec_connections AS decc 
    ON S.spid = decc.session_id
    WHERE     hostname='F00'
    GROUP BY     dbid, loginame,hostname,  
    net_library,  net_address, client_net_address


    I'm wondering why there're many connections sharing the the same hostname 'F00' but with different client_net_addresses.

    Jason,

    I dont know exactly the reason but does below also return same thing

    SELECT s. host_name ,
            client_net_address
     FROM     sys.dm_exec_sessions S 
     INNER JOIN    sys.dm_exec_connections AS decc 
     ON S.session_id = decc.session_id
     WHERE     s.host_name='F00'


    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Wiki Articles

    MVP

    Tuesday, February 16, 2016 8:06 AM
  • Thanks.
    It returns all same hostname with different IPs.
    Tuesday, February 16, 2016 8:59 AM
  • Thanks.
    It returns all same hostname with different IPs.

    Then this is not a SQL Server issue but something configured from DNS. You should aks that team

    For reference see

    http://serverfault.com/questions/517501/is-it-possible-for-two-hostnames-share-the-same-ip-address

    

    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it

    My Wiki Articles

    MVP

    • Proposed as answer by Eric__Zhang Thursday, February 25, 2016 8:35 AM
    • Marked as answer by Eric__Zhang Wednesday, March 2, 2016 9:29 AM
    Tuesday, February 16, 2016 9:09 AM