Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    268

    Unanswered: connections to SQL Server

    Hi All,

    I need to put a script together that would tell me how many connections to SQL Server there are at any given time. Which table would store this info?
    Thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Define what you mean by connections, and which version of SQL Server you are targeting. One simplistic answer for SQL 2000 would be:
    Code:
    SELECT Count(DISTINCT spid)
       FROM master.dbo.sysprocesses
       WHERE 50 < spid
    -PatP

  3. #3
    Join Date
    Apr 2006
    Posts
    33
    The information from the sp_who/sp_who2 stored procedures might also be useful...
    David Wiseman
    MCSE, MCSA, MCDBA

    www.wisesoft.co.uk

Posting Permissions

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