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,布布扣,bubuko.com

SQL Server创建LinkServer

上一篇:数据库基本常用类型解析


下一篇:log_archive_dest_n和standby_archive_dest