Viewing Linked Server Information in SQL Server 2005/2008

In one of my previous posts, I demonstrated how to create a Linked Server.

Now during maintenance, if you desire to view the linked servers on your SQL Server instance, use the ‘sys.servers’ system catalog view as shown below:

SELECT name, provider, data_source, connect_timeout, 
query_timeout, is_rpc_out_enabled
FROM sys.servers
WHERE is_linked = 1

OUTPUT


image



As part of the maintenance activities, you can also drop a linked server using the following query:


EXEC sp_dropserver @server= 'SUPROTIM-PC'

To remove related remote and linked server logins for the server, use ‘droplogins’ as the second parameter as shown below:


EXEC sp_dropserver @server= 'SUPROTIM-PC', @droplogins='droplogins'

Note: Use sp_helpserver to show available servers.


About The Author

Suprotim Agarwal, MCSD, MCAD, MCDBA, MCSE, is the founder of DotNetCurry, DNC Magazine for Developers, SQLServerCurry and DevCurry. He has also authored a couple of books 51 Recipes using jQuery with ASP.NET Controls and a new one recently at The Absolutely Awesome jQuery CookBook.

Suprotim has received the prestigous Microsoft MVP award for nine times in a row now. In a professional capacity, he is the CEO of A2Z Knowledge Visuals Pvt Ltd, a digital group that represents premium web sites and digital publications comprising of Professional web, windows, mobile and cloud developers, technical managers, and architects.

Get in touch with him on Twitter @suprotimagarwal, LinkedIn or befriend him on Facebook

No comments: