Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check how many connections are on the server

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
How can i check to see how many connections are connected to the server?? not users just connections. I am testing some VB code and what to see if my code is only connecting once or multipule times.

Thanks
 
You can also query the sysprocesses table.

Select * From master..sysprocesses

You could check for connections by a specified program.

Select * From master..sysprocesses
Where program_name='MyVBProg'

Or by a login name.

Select * From master..sysprocesses
Where loginame='dvannoy'

BTW: You will nearly always find that VB programs open more than one connection to SQL Server even though the program only performs one open statement. Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
tlbroadbent Your right about VB opening more then one connection to the DB. I noticed that yesterday when I was messing with sp_who. It will leave connections open when you do a transaction.I had 3 connections open then after a few minutes it will drop and go to a sleep status then showing only one connection. Thats interesting why it does that. I guess it doesnt matter much, I was just trying to manage LAN traffic and not bog down the server much. with 30-50 people hitting the DB I was getting worried.

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top