how many users r connected to the sqlserver

  • i want to know when the server is on at that moment how many users or clients are currently connected to the server and also what is the command to know the system ip addresss from sql server

  • You can use system procedure, it shows the information about login name, host name instead of IP address, also in which DB etc etc!

    sp_who ( it has info what command )

    sp_who2 ( more information what happened to your SQL Server)

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

  • Or you can use the newer DMVs

    SELECT count(*) from sys.dm_exec_connections

    You can also get the IP address fron the same dmv

    SELECT login_name, HOST_NAME, client_net_address

    FROM sys.dm_exec_connections c INNER JOIN sys.dm_exec_sessions s ON c.session_id = s.session_id

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • GilaM thnx for alternatives!

    :hehe:

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply