sp_client_addr

Description

Displays the IP (Internet Protocol) address of every Adaptive Server task with an attached client application, including the spid and the client host name.

Syntax

sp_client addr[ “spid”]

Parameters

spid

specifies one task for which you require an IP address.

Examples

Example 1

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)

Example 2

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)

Example 3

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)

Example 4

shows the result of a task with no attached client (Housekeeper, for example).

sp_client_addr 9

----------
spid   hostname  ipaddr
-------------------------------
9                NULL
(1 row affected)
(return status = 0)

Example 5

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)

Usage

Permissions

Any user can execute sp_client_addr.

See also

System procedures sp_who