cancel
Showing results for 
Search instead for 
Did you mean: 

Getting list of connections with client name and name of the app

Former Member
5,893

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

Accepted Solutions (1)

Accepted Solutions (1)

VolkerBarth
Contributor

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=".

Answers (1)

Answers (1)

reimer_pods
Participant

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.