• 建立SQL链接服务器


      

      访问链接服务器的格式:select * from [IPMLBZ].[数据库].[dbo].WEB_ItemInfo

      有一个最简单的方法就是直接鼠标新建,这样是以ip为开头的,也可以通过下面的代码进行创建,这样的话就可以换名字了。。。。。。

    @server名字全部改为你的链接服务器名字,@datasec改为链接服务器实例名,@rmtpassword改为登陆密码,完事~

    USE [master]
    GO
    
    /****** Object:  LinkedServer [IPDYH]    Script Date: 2018/2/9 9:11:53 ******/
    EXEC master.dbo.sp_addlinkedserver @server = N'IPDYH', @srvproduct=N' ', @provider=N'SQLNCLI', @datasrc=N'192.168.0.16QYDYHMSSQL'
     /* For security reasons the linked server remote logins password is changed with ######## */
    EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'IPDYH',@useself=N'False',@locallogin=NULL,@rmtuser=N'sa',@rmtpassword='@KTYpms123'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'collation compatible', @optvalue=N'false'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'data access', @optvalue=N'true'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'dist', @optvalue=N'false'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'pub', @optvalue=N'false'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'rpc', @optvalue=N'false'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'rpc out', @optvalue=N'false'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'sub', @optvalue=N'false'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'connect timeout', @optvalue=N'0'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'collation name', @optvalue=null
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'lazy schema validation', @optvalue=N'false'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'query timeout', @optvalue=N'0'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'use remote collation', @optvalue=N'true'
    GO
    
    EXEC master.dbo.sp_serveroption @server=N'IPDYH', @optname=N'remote proc transaction promotion', @optvalue=N'true'
    GO
  • 相关阅读:
    Thread的run方法和start方法
    35. Search Insert Position
    Error:(1, 1) java: 非法字符: 'ufeff'
    final修饰的变量是引用不可变,还是对象不可变
    数组与练习
    java反射机制【转】
    Socket
    面向对象的设计原则和设计模式
    多线程
    为什么有时候修改了css文件,页面的样式却没有改变?
  • 原文地址:https://www.cnblogs.com/yunquan/p/8434628.html
Copyright © 2020-2023  润新知