The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

Using SQL, how can I get the same list as "Connected Users" tab in Sybase Central? (SQL Anywhwere 9.0)

asked 30 Jun '11, 08:53

henginy's gravatar image

henginy
406151827
accept rate: 0%


I guess

call sa_conn_info()

will give you the desired information - at least partially. Here's the doc for 12.0.1.

permanent link

answered 30 Jun '11, 09:42

Volker%20Barth's gravatar image

Volker Barth
29.3k287438644
accept rate: 32%

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
showing 1 of 7 show all flat view
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×97
×95

question asked: 30 Jun '11, 08:53

question was seen: 4,650 times

last updated: 05 Oct '12, 08:51