Displays the IP (Internet Protocol) address of every Adaptive Server task with an attached client application, including the spid and the client host name.
sp_client addr[“spid”]
specifies one task for which you require an IP address.
Lists IP addresses for all tasks:
sp_client_addr
--------- spid hostname ipaddr ----------------------------- 11 FRED 162.66.131.36 21 BARNEY 162.66.100.233 22 WILMA 162.66.100.206 23 BETTY 162.66.100.119 24 PEBBLES 162.66.100.125 25 BAMBAM 162.66.100.124 (6 rows affected) (return status = 0)
Shows IP addresses for spid 21:
sp_client_addr 21
---------- spid hostname ipaddr ----------------------------- 21 BARNEY 162.66.100.233 (1 row affected) (return status = 0)
Shows the result when a client application is not connected via IP:
sp_client_addr 11
---------- spid hostname ipaddr ----------------------------- 11 FRED 0.0.0.0 (1 row affected) (return status = 0)
Shows the result of a task with no attached client; for example, Housekeeper:
sp_client_addr 9
---------- spid hostname ipaddr ------------------------------- 9 NULL (1 row affected) (return status = 0)
Shows the result when an incorrect spid is specified:
sp_client_addr 99
---------- Msg 18934, Level 16, State 1: Procedure "sp_client_addr", Line 32: spid not found (return status = 1)
If the client application is not attached by IP, the address appears as 0.0.0.0. Adaptive Server does not support display of addresses of protocols other than IP.
If a task has no attached client (Housekeeper, for instance), the IP address appears as “NULL”. Tasks with no attached client are not listed when you use sp_client_addr with no parameter.
Any user can execute sp_client_addr.
System procedures sp_who