Returns the connection ID as Number, and the PropNum, PropName, PropDescription, and Value for each available connection property.
Values are returned for all connection properties, database option settings related to connections, and statistics related
to connections. Valid properties with NULL values are also returned.
If no connidparm is supplied, properties for all connections to the current database are returned. If connidparm is less than zero, property values for the current connection are returned.
Cloud note: Because of tenant database isolation rules, when this system procedure is run in the cloud it returns only information about
the current tenant database.
The following example uses the sa_conn_properties system procedure to return a result set summarizing connection property
information for all connections.
CALL sa_conn_properties( );
This example uses the sa_conn_properties system procedure to return a list of all connections, in decreasing order by CPU
SELECT Number AS connection_number,
CONNECTION_PROPERTY ( 'Name', Number ) AS connection_name,
CONNECTION_PROPERTY ( 'Userid', Number ) AS user_id,
CAST ( Value AS NUMERIC ( 30, 2 ) ) AS approx_cpu_time
WHERE PropName = 'ApproximateCPUTime'
ORDER BY approx_cpu_time DESC;