Results 1 to 6 of 6
  1. #1
    Join Date
    May 2002
    Location
    Montréal, Canada
    Posts
    28

    Unanswered: count active connections

    Hi,

    Does anybody know how I could count current active connections on a database?

    For exemple, currently, if I want to see how many connections are opened on a specific DB, I try to detach the DB, then it tells me how many active connections are opened on it; I just don't know where to get this information with my own script, a kind of:

    SELECT NB_ACTIVE_CONNECTION ON [MY_DB]

    Thanks for your help!
    Data Climber

  2. #2
    Join Date
    Oct 2002
    Posts
    5

    Re: count active connections

    try doing something with sp_who

  3. #3
    Join Date
    May 2002
    Location
    Montréal, Canada
    Posts
    28

    Re: count active connections

    Thanks, I get a resultset. Too bad I don't have access to sp_who source code do custom my own stored proc.

    Thanks again!
    Data Climber

  4. #4
    Join Date
    Dec 2001
    Location
    Toronto, Canada
    Posts
    335
    Of course you have access to the sp_who source code. Just to a sp_helptext sp_who, in master. This will display the source code. You can copy it and create your own. Just don't call it sp_who. You can call it sp_MyWho.
    MCDBA

  5. #5
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    of course you could just query master.dbo.sysprocesses
    Paul Young
    (Knowledge is power! Get some!)

  6. #6
    Join Date
    May 2002
    Location
    Montréal, Canada
    Posts
    28
    achorozy: Your so much right, I guess I need holidays, I completly forgot about master! The best is I often go on it to catch some scripts. Bang bang on my head!

    paul young: I have to check this, never tried it.

    Thanks all of you for helping.
    Data Climber

Posting Permissions

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