Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2001
    Location
    Barcelona
    Posts
    32

    Unanswered: number of connections

    How can I know the number of open connections to a database from a client application (via ADO)?

  2. #2
    Join Date
    Dec 2001
    Location
    Toronto, Canada
    Posts
    335
    To find out how many users are connected:
    Code:
    select count(*) 
    from master..sysprocesses
    where uid <> 1
    The 'uid <> 1' excludes system connections.

  3. #3
    Join Date
    Oct 2001
    Location
    England
    Posts
    426
    select count(*)
    from master..sysprocesses
    where dbid = db_id('dbname')
    and hostname = 'appname'

    You will have to check the hostname in sysprocesses to find how the application connects.
    You can also log all connects and disconnects to a table or text file using the profiler.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •