SQL Server创建LinkServer
USE [master] GO /****** Object: LinkedServer [xxx_LNK] Script Date: 2014/7/7 17:04:13 ******/ EXEC master.dbo.sp_addlinkedserver @server = N'xxx_LNK', @srvproduct=N'xxx_LNK', @provider=N'SQLNCLI', @datasrc=N'xxx.xx.xxx.xx', @catalog=N'CMD' /* For security reasons the linked server remote logins password is changed with ######## */ EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'xxx_LNK',@useself=N'False',@locallogin=NULL,@rmtuser=N'dev',@rmtpassword='########' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'collation compatible', @optvalue=N'false' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'data access', @optvalue=N'true' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'dist', @optvalue=N'false' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'pub', @optvalue=N'false' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'rpc', @optvalue=N'true' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'rpc out', @optvalue=N'true' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'sub', @optvalue=N'false' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'connect timeout', @optvalue=N'0' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'collation name', @optvalue=null GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'lazy schema validation', @optvalue=N'false' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'query timeout', @optvalue=N'0' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'use remote collation', @optvalue=N'true' GO EXEC master.dbo.sp_serveroption @server=N'xxx_LNK', @optname=N'remote proc transaction promotion', @optvalue=N'true' GO