sp_addserver

Description

Defines a remote server, or the name of the local server; specifies the server for remote procedure calls (RPCs) when using the host and port parameters.

Syntax

sp_addserver lname [, class [, pname]]

Component Integration Services (CIS) only:

sp_addserver 'logical_server_name', ASEnterprise, 'host:port:filter'

Parameters

lname

is the name used to address the server on your system. sp_addserver adds a row to the sysservers table if there is no entry already present for lname. Server names must be unique and must conform to the rules for identifiers.

class

identifies the category of server being added. A server class of “null” defaults to “ASEnterprise”. Allowable values for the class parameter are:

  • local – local server (there can be only one) used only once after start-up, or after restarting Adaptive Server, to identify the local server name so that it can appear in messages printed by Adaptive Server

  • null – remote server with no category defined

  • ASEnterprise – all versions of Adaptive Server Enterprise; support for SQL Server 4.9 is not provided.

  • ASAnywhere – Adaptive Server Anywhere version 6.0 or later.

  • ASIQ – a server with server class ASIQ is any version of Adaptive Server IQ of 12.0 or later.

  • direct_connect (Component Integration Services only) – an Open Server-based application that conforms to the direct_connect interface specification.

  • sds– conforms to the interface requirements of a Specialty Data Store™ as described in the Adaptive Server Specialty Data Store Developer’s Kit manual.

See “Remote Servers” in Chapter 2, “Understanding Component Integration Services” of the Component Integration Services User’s Guide for details on these parameter values.

NoteAdaptive Server does not support server class db2. To use db2, migrate your db2 server class to direct_connect class.

pname

is the name in the interfaces file for the server named lname. This enables you to establish local aliases for other Adaptive Servers or Backup Servers that you may need to communicate with. If you do not specify a pname, lname is used.

(Component Integration Services only) You can use pname to specify the hostname or IP address and the port of the server you wish to connect to. This enables you to bypass the need for directory services (such as LDAP or an interfaces file) for the server when using the CT-Library. Use the following format:

  • "hostname:port"
    
  • "ipaddr:port"
    

NoteYou must enclose the hostname and port with single or double quotes to use this option.

filter

in cluster environments – adds a remote server for remote procedure calls (RPCs).

filter = ssl [= 'CN = common_name']

Use this format to declare the host:port number:

ip_address:port

Examples

Example 1

(In cluster environments) Adds a remote server named “big_logical_server.”

sp_addserver 'big_logical_server', ASEntrprise, 
    'maynard:23954:ssl= "CN=ase1.big server 1.com"'

The rules for common names are the same as those used for dynamic listeners and the directory service entries.

Example 2

Adds an entry for a remote server named GATEWAY in master.dbo.sysservers. The pname is also GATEWAY:

sp_addserver GATEWAY

Example 3

Adds an entry for a remote server named GATEWAY in master.dbo.sysservers. The pname is VIOLET. If there is already a sysservers entry for GATEWAY with a different pname, the pname of server GATEWAY changes to VIOLET:

sp_addserver GATEWAY, null, VIOLET

Example 4

Adds an entry for the local server named PRODUCTION:

sp_addserver PRODUCTION, local

Example 5

(Component Integration Services only) Adds an entry for a remote Adaptive Server with the host name “myhost” with port number 10224:

sp_addserver S1, ASEnterprise, "myhost:10224"

NoteIf you use this syntax for pname, the Adaptive Server site handler cannot successfully connect to this server; only CIS connections recognize this syntax for pname.

Example 6

(Component Integration Services only) Adds an entry for a remote Adaptive Server with the host IP 192.123.456.010 with port number 11222:

sp_addserver S3, direct_connect, "192.123.456.010:11222"

Usage

Permissions

Only a system security officer can execute sp_addserver.

Auditing

Values in event and extrainfo columns from the sysaudits table are:

Event

Audit option

Command or access audited

Information in extrainfo

38

exec_procedure

Execution of a procedure

  • Roles – Current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – All input parameters

  • Proxy information – Original login name, if set proxy in effect

See also

Documents Component Integration Services User’s Guide.

System procedures sp_addremotelogin, sp_dropremotelogin, sp_dropserver, sp_helpremotelogin, sp_helpserver, sp_serveroption