hi,
i using sql server 2000 with 4 or 6 clientes and i need to know in any clientes at any time which clientes are connected to the sql server.
There is any way or function of the sql server that permit to get the ip or any information of the currents connection´s to the sql server?
thanks for the attention
bruno
12-09-2006 at 08:38 PM
|
GeoffS Level: VB Lord Registered: 29-09-2004 Posts: 536
Re: sql server connection and vb6
Hi bruno,
You can run the built-in stored procedure "sp_who" with the "dbname" parameter:-
USE master
EXEC sp_who 'databasename'
This will return a result set that contains info about who is connected to your database and the name of their computer. If you run the sp without the param it will list all connections and show which database they are connected to and if they are currently active.
Take a look at the SQL2000 Help files for more info - and also have a look at "sp_monitor" which will return all kinds of info about whats going on.
____________________________ multi-tasking - the ability to hang more than one app. at the same time.
13-09-2006 at 04:52 PM
|
yronium Level: Moderator Registered: 14-04-2002 Posts: 907
Re: sql server connection and vb6
Hello. Alternately, you can reference a SQLDMO object to your project: it exposes several useful features to monitor connections, activeusers, activeservers, SQLServer dirs, and so on.
Hope it helps
____________________________
Real Programmer can count up to 1024 on his fingers