on 2011 Jun 30 9:53 AM
Using SQL, how can I get the same list as "Connected Users" tab in Sybase Central? (SQL Anywhwere 9.0)
I guess
call sa_conn_info()
will give you the desired information - at least partially. Here's the doc for 12.0.1.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
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.
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;
User | Count |
---|---|
68 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.