How to Remove a Database Link
Database links are used to connect one database server to another so that programmers can query multiple servers from one location. It's a convenient way to have separate database servers with different types of applications. For instance, you may have a database server that hosts only reports and another that hosts only customer applications. Linking the reports server to the customer database makes it convenient to query both from one server. However, an administrator may want to remove the database link. This is done in the management console.
Instructions
-
-
1
Click the Windows "Start" button and select "Programs." From the menu, select "Microsoft SQL Server Management Console."
-
2
Remove database links for only certain logins. This syntax removes a link only for the associated login credentials: sp_dropserver @server='MyServerName', @droplogins='MyLogin'.
-
-
3
Remove a link completely. The following syntax removes the link entirely. After running this code, any stored procedures or developers querying the other server will fail:
sp_dropserver @server='MyOtherServer'. -
4
Review the confirmation. When running the code to remove a link, SQL Server displays an integer of 1 or 0 for confirmation. If a 1 is returned, the command was successful.
-
1