Applies To: SQL Server 2014, SQL Server 2016 Preview
Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).
Removes a server from the list of known remote and linked servers on the local instance of SQL Server.
Applies to: SQL Server (SQL Server 2008 through current version).
If you run sp_dropserver on a server that has associated remote and linked server login entries, or is configured as a replication publisher, an error message is returned. To remove all remote and linked server logins for a server when you remove the server, use the droplogins argument.
sp_dropserver cannot be executed inside a user-defined transaction.
The following example removes the remote server ACCOUNTS and all associated remote logins from the local instance of SQL Server.
sp_dropserver 'ACCOUNTS', 'droplogins';