SQL Server创建LinkServer

USE [master]
GO

/****** Object:  LinkedServer [xxx_LNK]    Script Date: 2014/7/7 17:04:13 ******/
EXEC master.dbo.sp_addlinkedserver @server = Nxxx_LNK, @srvproduct=Nxxx_LNK, @provider=NSQLNCLI, @datasrc=Nxxx.xx.xxx.xx, @catalog=NCMD
 /* For security reasons the linked server remote logins password is changed with ######## */
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=Nxxx_LNK,@useself=NFalse,@locallogin=NULL,@rmtuser=Ndev,@rmtpassword=########

GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Ncollation compatible, @optvalue=Nfalse
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Ndata access, @optvalue=Ntrue
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Ndist, @optvalue=Nfalse
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Npub, @optvalue=Nfalse
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Nrpc, @optvalue=Ntrue
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Nrpc out, @optvalue=Ntrue
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Nsub, @optvalue=Nfalse
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Nconnect timeout, @optvalue=N0
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Ncollation name, @optvalue=null
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Nlazy schema validation, @optvalue=Nfalse
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Nquery timeout, @optvalue=N0
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Nuse remote collation, @optvalue=Ntrue
GO

EXEC master.dbo.sp_serveroption @server=Nxxx_LNK, @optname=Nremote proc transaction promotion, @optvalue=Ntrue
GO

 

SQL Server创建LinkServer,古老的榕树,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。