zoukankan      html  css  js  c++  java
  • 跨服务器连接数据库

    set ANSI_NULLS ON
    set QUOTED_IDENTIFIER ON
    go
    
    CREATE  PROCEDURE [dbo].[DH_ReceiveFileInserts]
        (
          @djh NVARCHAR(50) ,
          @djrq datetime ,
          @flh NVARCHAR(50),
       @wh NVARCHAR(50),
       @wjbt NVARCHAR(50),
       @zrz NVARCHAR(50),
       @bgqx NVARCHAR(50),
       @mj NVARCHAR(50),
       @cwrq datetime,
       @ztc NVARCHAR(50),
       @ys NVARCHAR(50),
          @fs NVARCHAR(50),
       @qwbs NVARCHAR(50),
       @hjcd NVARCHAR(50),
       @bz NVARCHAR(50),
       @cbjg NVARCHAR(50),
       @wb NVARCHAR(50),
       @lwdw NVARCHAR(50),
       @cjyqk NVARCHAR(50),
       @cjybs NVARCHAR(50)
        )
    AS 
        SET NOCOUNT OFF
        INSERT  INTO ITSV.GJJOA.dbo.wj14
          (djh,djrq,flh,wh, wjbt, zrz,bgqx, mj, cwrq, ztc, ys, fs,qwbs,hjcd,bz,cbjg,wb,lwdw,cjyqk,cjybs, fj, jg_id, bm_id, sign, dalx ) 
      values (@djh, @djrq, @flh, @wh, @wjbt, @zrz,@bgqx, @mj, @cwrq, @ztc, @ys, @fs,@qwbs,@hjcd,@bz,@cbjg,@wb,@lwdw,@cjyqk,@cjybs, '', 0, 0, 'f', 'wj1429')
    exec sp_dropserver 'ITSV','droplogins'
    exec sp_addlinkedserver 'ITSV','','SQLOLEDB','10.10.1.17'
    exec sp_addlinkedsrvlogin 'ITSV','false',null,'sa','ntgjj'
    
    //创建链接
    exec sp_addlinkedserver '别名','','SQLOLEDB','服务器地址'
    exec sp_addlinkedsrvlogin '别名','false',null,'登录名','密码'
    //删除链接
    exec sp_dropserver '别名','droplogins' 
    //使用 
    select * from 别名.数据库名.dbo.表名
  • 相关阅读:
    集群和高可用
    haproxy-负载均衡介绍
    HAproxy负载均衡-ACL篇
    Haproxy配置文件(2)
    Haproxy原理(1)
    Haproxy状态监控配置教程
    在Windows中单机环境下创建RabbitMQ集群
    Haproxy------在windows下配置负载均衡
    负载均衡的软件
    HAProxy的三种不同类型配置方案
  • 原文地址:https://www.cnblogs.com/deep-blue/p/5110117.html
Copyright © 2011-2022 走看看