Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Checking for open connnections

Author  Topic 

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2002-08-08 : 22:04:54
I was wondering if there was a way to see if there is an open connection to a database, how many there are, and where there from. (i.e. webpage [with URL and IP of person on webpage], the enterprise manager, query analyzer, ext)?

--
For thouse with wings, fly to your dreams.

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-08-08 : 22:12:04
You can run sp_who or sp_who2, it will identify all open connections, and the host_name column will provide some indication of what kind of app is using that connection.

You can't get IP addresses of web browsers because:

A) They're not connecting to the SQL Server directly, they're browsing the web server which is making the connection, so you'd only get the web server's IP

B) You'd have to pass the browser's IP address from the web server to SQL Server as regular data, and if the web server is using connection pooling, the IP address will change for the same connection

C) Unless you have ridiculously long transactions that are death to web apps, a browser won't be hitting SQL Server for more than a few seconds anyway

Go to Top of Page

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2002-08-08 : 22:16:28
Thanks. The sp_who2 command is doing what I want (with the exeption of the IP but I guss that is no big deal)

--
For thouse with wings, fly to your dreams.
Go to Top of Page
   

- Advertisement -