Need to find out number of connecting users and devices - SQL2008

  • Hi - Iv'e been asked to find out the number of connecting users and devices for some of our SQL2008 Servers. This is required as part of a license audit, does anyone know where I'm able to obtain this information?

    Any help would be very much appreciated.

    Regards

    Dax

  • exec sp_who2 might be what you need.

  • You can see live connections by querying sys.dm_exec_requests. But to really audit connections, I'd suggest using the extended events. You can then capture all connection events to the server.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Hi, maybe this can help:

    SELECTdb_name(dbid) AS DB,

    count(dbid) AS Connections,

    loginame AS LoginName

    FROMsys.sysprocesses

    GROUP BY dbid, loginame

    ORDER BY DB

  • Hi - Many thanks for the reply. Does this give me the number of user connections per DB or device connections?

    Kind Regards

    Dax

  • dax.latchford (9/15/2014)


    Hi - Many thanks for the reply. Does this give me the number of user connections per DB or device connections?

    Kind Regards

    Dax

    Any of the methods listed can. But if you want literal counts of connections over time, you're best off with the extended events. The other queries are going to require additional work to get the counts because you'll have to eliminate duplicates and poll them over and over. It really depends on what exactly you want.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 6 posts - 1 through 5 (of 5 total)

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