zoukankan      html  css  js  c++  java
  • 建立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
  • 相关阅读:
    342. Power of Four(One-line)
    mysql的启动,停止与重启
    PHP学习笔记之interface关键字
    PHP学习笔记之析构函数以及static,self,parent关键字
    每天一个linux命令(1):ln 命令
    MySQL学习笔记:regexp正则表达式
    AARRR:数据运营模型
    MySQL学习笔记:从一个表update到另外一个表
    MySQL学习笔记:计算机服务中找不到MySQL服务
    MySQL学习笔记:insert into select
  • 原文地址:https://www.cnblogs.com/yunquan/p/8434628.html
Copyright © 2011-2022 走看看