Removes a server from the list of known remote and linked servers on the local Microsoft® SQL Server™.
sp_dropserver [@server =] 'server' [, [@droplogins =]{'droplogins' | NULL}]
0 (success) or 1 (failure)
Running sp_dropserver on a server that has associated remote and linked server login entries results in an error message stating that logins must be removed before removing the remote or linked server. To remove all remote and linked server logins for a server when removing the server, use the droplogins argument.
sp_dropserver cannot be executed inside a user-defined transaction.
Only members of the sysadmin or setupadmin fixed server roles can execute sp_dropserver.
This example removes the remote server ACCOUNTS and all associated remote logins from the local SQL Server.
sp_dropserver 'ACCOUNTS', 'droplogins'
sp_addserver | sp_helpserver |
sp_dropremotelogin | System Stored Procedures |
sp_helpremotelogin |