I guess call sa_conn_info() will give you the desired information - at least partially. Here's the doc for 12.0.1. 1
Thanks for the pointer. I found sa_conn_activity procedure that does a similar job and altered it to include some other properties I needed.
(04 Jul '11, 02:49)
henginy
Replies hidden
3
I hope by "altered it" you really mean that you defined your own procedure with a different name with similar code? If not, then I highly recommend that you not actually change the definition of dbo.sa_conn_activity() because if you do you will lose your definition (and it will be revert back to the original) if you ever unload/reload your database or do a ALTER DATABASE PROCEDURE ON.
(04 Jul '11, 11:13)
Mark Culp
or an "ALTER DATABASE UPGRADE PROCEDURE ON" - yes, one of my current favourites:)
(04 Jul '11, 11:24)
Volker Barth
I had to change the actual procedure. Yeah, I know. I tried to define my own but there's a "next_connection" function call inside and I cannot access it in my own procs (is that possible?). Actually this is all about monitoring incoming queries to the server. My .NET program saves a copy of the original definition and pushes its own version. So both versions are safe. There might be a better way to do the same thing, but I haven't come across any yet.
(05 Jul '11, 03:26)
henginy
Of course you can use the next_connection() function in your own code - typically in a loop, e.g. something like declare nConnId integer; set nConnId = (select next_connection(null)); while nConnId is not null loop -- do something with nConnId set nConnId = (select next_connection(nConnId)); end loop;
(05 Jul '11, 04:27)
Volker Barth
Comment Text Removed
You can type only: select number from sa_conn_info();
(05 Oct '12, 08:19)
LGregianin
Sure you can. However, here my point was to show how to use a next_connection() loop...
(05 Oct '12, 08:51)
Volker Barth
|