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”. 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.
Adaptive Server does not support server class db2. To use db2, migrate your db2 server class to direct_connect class.
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.
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 |
|
Documents Component Integration Services User’s Guide.
System procedures sp_addremotelogin, sp_dropremotelogin, sp_dropserver, sp_helpremotelogin, sp_helpserver, sp_serveroption