Export (0) Print
Expand All
Expand Minimize

sp_dropremotelogin

SQL Server 2000

Removes a remote login mapped to a local login used to execute remote stored procedures against the local server running Microsoft® SQL Server™.

Syntax

sp_dropremotelogin [ @remoteserver = ] 'remoteserver'
    [ , [ @loginame = ] 'login' ]
    [ , [ @remotename = ] 'remote_name' ]

Arguments

[@remoteserver =] 'remoteserver'

Is the name of the remote server mapped to the remote login that is to be removed. remoteserver is sysname, with no default. remoteserver must already exist.

[@loginame =] 'login'

Is the optional login name on the local server that is associated with the remote server. login is sysname, with a default of NULL. login must already exist if specified.

[@remotename =] 'remote_name'

Is the optional name of the remote login that is mapped to login when logging in from the remote server. remote_name is sysname, with a default of NULL.

Return Code Values

0 (success) or 1 (failure)

Remarks

If only remoteserver is specified, all remote logins for that remote server are removed from the local server. If login is additionally specified, all remote logins from remoteserver mapped to that specific local login are removed from the local server. If remote_name is also specified, only the remote login for that remote user from remoteserver is removed from the local server.

To add local server users, use sp_addlogin. To remove local server users, use sp_droplogin.

Remote logins are only required when using earlier versions of SQL Server. SQL Server version 7.0 uses linked server logins instead. Use sp_addlinkedsrvlogin and sp_droplinkedsrvlogin to add and remove linked server logins.

sp_dropremotelogin cannot be executed within a user-defined transaction.

Permissions

Only members of the sysadmin or securityadmin fixed server roles can execute sp_dropremotelogin.

Examples
A. Drop all remote logins for a remote server

This example removes the entry for the remote server ACCOUNTS, thereby removing all mappings between logins on the local server and remote logins on the remote server.

EXEC sp_dropremotelogin 'ACCOUNTS'
B. Drop a login mapping

This example removes the entry for mapping remote logins from the remote server ACCOUNTS to the local login Albert.

EXEC sp_dropremotelogin 'ACCOUNTS', 'Albert'
C. Drop a remote user

This example removes the login for the remote login Chris on the remote server ACCOUNTS that was mapped to the local login salesmgr.

EXEC sp_dropremotelogin 'ACCOUNTS', 'salesmgr', 'Chris'

See Also

sp_addlinkedsrvlogin

sp_addlogin

sp_addremotelogin

sp_addserver

sp_droplinkedsrvlogin

sp_droplogin

sp_helpremotelogin

System Stored Procedures

Show:
© 2014 Microsoft