• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

Current connections to Server

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 connection...to 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

2 Solutions
sp_who2 'Active'
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
lrbristerAuthor Commented:
You're both correct.
This is a permissions issue...it runs fine on the DEV server...but not the live one.

I'll have to track it down

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now