zoukankan      html  css  js  c++  java
  • sql 跨服务器 导入数据


    exec sp_addlinkedserver @server = N'LinkServer2',
    @srvproduct = N' ',
    @provider = N'SQLOLEDB',
    @datasrc = N'127.0.0.1',    访问的ip地址
    @catalog = N'GomeCPS';
    exec sp_addlinkedsrvlogin N'LinkServer2', false, N'NationalUsers', N'groupUser', N'P@ssw0rd';
    go
    --insert into WebSites (WebSiteID, EarnerInfoID, WebName, WebURL, WebType, WebIntro, Status, ValidateKey, ValidateStatus, CreateTime, ExtendType, UserName, ECUid, CheckOffTime)
    --select WebSiteID, EarnerInfoID, WebName, WebURL, WebType, WebIntro, Status, ValidateKey, ValidateStatus, CreateTime, ExtendType, UserName, ECUid, CheckOffTime
    --from LinkServer2.GomeCPS.dbo.WebSites where WebSiteID not in('5549','5550','5551','5552','5553','5554')
    insert into CPSOriDataOccur( s_id, o_cd, o_status, o_date, p_cd, p_num, p_name, price, categoryId, feedback, p_price, Commission, CreateTime, s_uuid, c_states, s_ip, h_states, CommissionRatio, wID, AdType, AdID, ProID, webSite, orderSite, OrderSettlement, MemberNo, OmnitureFlag, ProductId)
    select s_id, o_cd, o_status, o_date, p_cd, p_num, p_name, price, categoryId, feedback, p_price, Commission, CreateTime, s_uuid, c_states, s_ip, h_states, CommissionRatio, wID, AdType, AdID, ProID, webSite, orderSite, OrderSettlement, MemberNo, OmnitureFlag, ProductId
    from LinkServer2.GomeCPS.dbo.CPSOriDataOccur where CreateTime >'2014-09-20'

    --以后不再使用时删除链接服务器
    exec sp_dropserver 'LinkServer2','droplogins';

  • 相关阅读:
    上传图片到FTP的实例
    关于浏览器兼容问题:获取div的值
    多张表数据导入到execl中
    把泛型转换成dataTable
    关于游标
    Excel 公式 两个时间比大小
    SQL 执行顺序
    VBA实现随意输入组合码,查询唯一标识码
    IIS7 503错误 Service Unavailable
    汇总文件数据 VBA
  • 原文地址:https://www.cnblogs.com/fu123/p/5139695.html
Copyright © 2011-2022 走看看