1 Version 4.0 -- 1/15/89 sp_addremotelogin
______________________________________________________________________
NAME: sp_addremotelogin
FUNCTION:
Authorizes a new remote server user by adding an entry to
master.dbo.sysremotelogins.
SYNTAX:
sp_addremotelogin remoteserver [,[,localname] remotename]
EXAMPLES:
1) sp_addremotelogin GATEWAY
sp_addremotelogin Version 4.0 -- 1/15/89 2
______________________________________________________________________
This creates an entry in the sysremotelogins table which maps the
remotename given at remote login time from the remote server
GATEWAY as the localname for purposes of login validation. This
is a simple way to automatically map remotenames into localnames
when the local and remote servers have the same users.
2) sp_addremotelogin GATEWAY, albert
This creates an entry that maps remotenames from the GATEWAY
server that are not listed in sysremotelogins into a particular
localname on the local server.
3) sp_addremotelogin GATEWAY, churchy, pogo
This causes a remote login from the remote user pogo on the
remote server GATEWAY to be mapped into the local user churchy.
3 Version 4.0 -- 1/15/89 sp_addremotelogin
______________________________________________________________________
PARAMETERS:
remoteserver - is the name of the remote server to which the
remote login applies. The server must be known to the local
server by an entry in the master.dbo.sysservers table.
localname - is the login name of the user on the local
SQL Server. The user named by localname must already exist
in the master.dbo.syslogins table.
remotename - is the name that the remote server uses when log-
ging in to the local server. All remote logins that aren't
explicitly matched to a local name are automatically matched
to a local name. In case 1 above the local name that is used
is the remote name used to log in. In case 2 above the local
name that is used is localname.
COMMENTS:
o When a remote login is received, the local server tries up to
three ways to map the remote user into a local user. The local
sp_addremotelogin Version 4.0 -- 1/15/89 4
______________________________________________________________________
server first tries to find an entry in sysremotelogins that
matches the remote server name and the remote user name. If
one is found then the local server user id for that row is used
to log the remote user in. If none is found, the local server
searches for an entry that has a remote name of NULL and a
local server user id that is not -1. In this case the remote
user is mapped into the local server user id. Finally, if the
previous user mapping attempts have failed to come up with a
match, the sysremotelogins table is checked for an entry that
has a remote name of NULL and a local server user id that is
-1. In this case whatever remote name was supplied by the
remote server is used to look for a local server user id in the
syslogins table.
o The name of the local user may be different on the remote
server.
o Every remote login entry has a status. The default status is
5 Version 4.0 -- 1/15/89 sp_addremotelogin
______________________________________________________________________
not trusted. This means that when a remote login comes in
using that entry, the password is checked. You can change the
status to trusted using the sp_remoteoption stored procedure.
If a remote login is trusted, the password won't be checked.
MESSAGES:
A remote login for the remote server remoteserver was created
successfully.
remoteserver.
A user with that remote login name for the remote server
has already been added. Drop that remote user before
choosing another remotename.
The specified remote server does not exist. Run the stored
procedure sp_helpserver to get a list of the existing
remote servers.
You have tried to define a remote login to the local server.
Logins to the local server are listed in
sp_addremotelogin Version 4.0 -- 1/15/89 6
______________________________________________________________________
master.dbo.syslogins.
remote server remoteserver.
You have tried to add a default-name mapping remote login
entry, e.g., examples 1 and 2 above, and one exists
already. Use sp_helpremotelogins to see the remote logins
for the remoteserver.
The name you supplied for the localname parameter isn't in the
syslogins table. If you supply a local name it must
currently exist as a user on the local server.
PERMISSIONS:
Execute permission to System Administrator.
TABLES USED:
master.dbo.sysservers, master.dbo.sysremotelogins,
master.dbo.syslogins
7 Version 4.0 -- 1/15/89 sp_addremotelogin
______________________________________________________________________
SEE ALSO:
sp_remoteoption, sp_dropremotelogin, sp_helpremotelogin,
sp_helpserver, sp_addserver, sp_addlogin