sp_dropserver System Stored Procedure

Drops a server from the list of known servers, deleting the entry from the master.dbo.sysservers table.

Syntax

sp_dropserver server_name [, droplogins]

where

server_name
Is the server to be dropped.
droplogins
Indicates that any remote logins for server_name should also be dropped.

Remarks

Running sp_dropserver on a server that has associated entries in the master.dbo.sysremotelogins table results in an error message, stating that you need to drop the remote users before you can drop the server. To drop all remote logins for a server when dropping the server, use the droplogins option.

Example

This example drops the remote server ACCOUNTS.

sp_dropserver ACCOUNTS

Permission

Execute permission defaults to the system administrator and cannot be transferred.

Tables Used

master.dbo.sysremotelogins, master.dbo.sysservers

See Also

sp_addserver sp_helpremotelogin
sp_dropremotelogin sp_helpserver