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. Table 8-4 lists allowable values for the class parameter:
class parameter value |
Description |
---|---|
access_server |
Component Integration Services only – Server coded to the DirectConnect™ specification |
db2 |
Component Integration Services only – Server accessible by Net-Gateway™ or MDI™ Database Gateway |
direct_connect |
Component Integration Services only – functionally the same as access_server |
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 |
sql_server |
Another Adaptive Server or Omni server (this is the default value) |
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.
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
Adds an entry for a remote server known to the local server as SQLSRV10. The remote server is of server class sql_server. The network_name for SQLSRV10 is SS_MOSS:
sp_addserver SQLSRV10, sql_server, SS_MOSS
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.
For information on using Component Integration Services, see the Component Integration Services User’s Guide.
Only a System Security Officer can execute sp_addserver.
System procedures sp_addremotelogin, sp_dropremotelogin, sp_dropserver, sp_helpremotelogin, sp_helpserver, sp_serveroption