代码演示:
/****** Object: LinkedServer [ZYT] Script Date: 10/23/2023 15:47:45 ******/
EXEC master.dbo.sp_addlinkedserver @server = N'链接名', @srvproduct=N' ', @provider=N'SQLNCLI', @datasrc=N'192.168.0.100'
/* For security reasons the linked server remote logins password is changed with ######## */
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'链接名',@useself=N'False',@locallogin=NULL,@rmtuser=N'登陆名',@rmtpassword='数据库密码'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'collation compatible', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'data access', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'dist', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'pub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'rpc', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'rpc out', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'sub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'connect timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'collation name', @optvalue=null
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'lazy schema validation', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'query timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'use remote collation', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'链接名', @optname=N'remote proc transaction promotion', @optvalue=N'true'
GO
- THE END -
非特殊说明,本博所有文章均为博主原创。
如若转载,请注明出处:https://www.zzzmxxkj.com/187.html
共有 0 条评论