set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[***_link]
AS
EXEC sp_addlinkedserver testlink,'','MSDASQL',NULL,NULL,'DRIVER={SQL Server};SERVER=localhost;Catalog=test;UID=sa;PWD=123456'
EXEC sp_addlinkedsrvlogin testlink,'false','sa','sa,123456'
第一个 testlink 链接名称,
http://msdn.microsoft.com/zh-cn/library/ms190479.aspx
http://msdn.microsoft.com/zh-cn/library/ms188279.aspx