Current connections to Server

Posted on 2011-05-05
Last Modified: 2012-05-11
I'm trying to see how many open connections to my databases there are from my web pages.

I have over a 120 intranet users of which at least 80% are connected and working at any moment.

My attached code however ALWAYS only returns one a single database
I know that can't be correct there are at least 6 databases in use at any moment as well.

Any suggestions?
SELECT DB_NAME(dbid) as 'DbName', COUNT(dbid) as 'Connections' 
   from master.dbo.sysprocesses with (nolock)
   WHERE dbid > 0 and DB_NAME(dbid) not in ('master','msdb')
   GROUP BY dbid

Open in new window

Question by:lrbrister
    LVL 6

    Accepted Solution

    sp_who2 'Active'
    LVL 4

    Assisted Solution

    I just executed the query and looks like it returns me all the connections. Please try to execute the below queries and analyse the data, you should see more details of what processes are currently accessing the databases.
      select * from master.dbo.sysprocesses

    Author Closing Comment

    You're both correct.
    This is a permissions runs fine on the DEV server...but not the live one.

    I'll have to track it down

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now