Hello,

i have seen a tool that can list all connections to a sqlanywhere 12 server with name of the client pc and name of the app that has the connection opened at the client. i haven't found a system procedure to list these information. can anybody tell me how to get this information with a sql statement?

kind regards Andreas

asked 20 May '15, 02:41

aihbrb's gravatar image

aihbrb
31122
accept rate: 0%


There are several system procedures and functions that can give you the desired information, such as sa_conn_info or the connection property 'AppInfo' - here's a small sample:

select number, name, NodeAddr, connection_property('AppInfo', sci.number)
from sa_conn_info() sci
order by 1

The 'AppInfo' value is a string of concatenated key/value pairs including the program name and the client machine name, you may use another system procedure named sa_split_list() to extract that:

call sa_split_list(connection_property('AppInfo'), ';')

will return each pair in its own row, and you may take the value of the rows with values starting with "HOST=" or "EXE=".

permanent link

answered 20 May '15, 04:12

Volker%20Barth's gravatar image

Volker Barth
30.3k300452659
accept rate: 32%

sa_conn_info is a system procedure which lists connections properties. You may use it in two different ways: call it without any parameters

exec sa_conn_info 
or use it in a SELECT statement, e.g.
SELECT NodeAddr FROM sa_conn_info ()
You can get more detailed information about connections using sa_conn_properties. Among the numerous properties "AppInfo" might be what you're looking for.

permanent link

answered 20 May '15, 04:10

Reimer%20Pods's gravatar image

Reimer Pods
4.2k334481
accept rate: 12%

edited 20 May '15, 04:14

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:

×125
×21

question asked: 20 May '15, 02:41

question was seen: 507 times

last updated: 20 May '15, 04:14