Dropping Linked Server In SQL Server 2008

In this article I will demonstrate how to drop linked server using sp_dropserver system stored procedure.
  • 4751

In this article I will demonstrate how to drop linked server using sp_dropserver system stored procedure. sp_dropserver  stored procedure is used to remove a linked server from SQL Server instance.

Syntax

sp_dropserver [ @server= ] 'server'

[,[@droplogins=]{'droplogins'|NULL}]

Here, server defines the name of linked server to be removed from SQL Server instance, using droplogins specifies login mappings are removed before dropping the linked server.

Working

Using sp_dropserver demonstrates removing a linked server from SQL Server instance. In above syntax droplogin option is used to drop existing login mappings. If you drop a linked server before removing logins, it will not dropped and error will occur.


© 2019 DotNetHeaven. All rights reserved.