Defines a remote server, or defines the name of the local server.
sp_addserver “lname” [, class [,” pname”]]
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.
identifies the category of server being added. A server class of “null” defaults to “ASEnterprise”. Table 1-4 lists allowable values for the class parameter:
See “Remote Servers” in Chapter 2, “Understanding Component Integration Services” of the Component Integration Services User’s Guide for details on these parameter values.
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"
You must enclose the hostname and port with single or double quotes to use this option.
Adds an entry for a remote server named GATEWAY in master.dbo.sysservers. The pname is also GATEWAY:
sp_addserver GATEWAY
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
Adds an entry for the local server named PRODUCTION:
sp_addserver PRODUCTION, local
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"
If 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.
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"
The sysservers table identifies the name of the local server and its options, and any remote servers that the local server can communicate with.
To execute a remote procedure call on a remote server, the remote server must exist in the sysservers table.
If lname already exists as a server name in the sysservers table, sp_addserver changes the remote server’s srvnetname to the name specified by pname. When it does this, sp_addserver reports which server it changed, what the old network name was, and what the new network name is.
The installation or upgrade process for your server adds an entry in sysservers for a Backup Server. If you remove this entry, you cannot back up your databases.
Adaptive Server requires that the Backup Server have an lname of SYB_BACKUP. If you do not want to use that as the name of your Backup Server, or if you have more than one Backup Server running on your system, modify the pname for server SYB_BACKUP with sp_addserver so that Adaptive Server can communicate with Backup Server for database dumps and loads.
If you specify an lname, pname and class that already exist in sysservers, sp_addserver prints an error message and does not update sysservers.
Use sp_serveroption to set or clear server options.
Only a System Security Officer can execute sp_addserver.
Documents For information on using Component Integration Services, see the Component Integration Services User’s Guide.
System procedures sp_addremotelogin, sp_dropremotelogin, sp_dropserver, sp_helpremotelogin, sp_helpserver, sp_serveroption