【问题标题】:Update query on SQL Server with link server with oracle使用带有 oracle 的链接服务器更新 SQL Server 上的查询
【发布时间】:2014-07-21 10:26:31
【问题描述】:

我想从链接服务器 (oracle) 表中更新 SQL Server 2008 中的列。 我的表格列是opr_codem_code 等。 在具有 opr_code 值的 SQL Server 表中。

我想从链接服务器 (oracle) 更新 SQL Server 中的 m_code 值,其中常见值为 opr_code,即 oracle 中的 conf_code。我尝试了以下查询

update test_S set m_code=A.M_CODE from
      (Select * FROM OPENQUERY(linkserver,'Select * From abcd.NAME_desk)) A
      inner join test_S B on b.opr_code=a.conf_code

【问题讨论】:

    标签: sql sql-server oracle linked-server


    【解决方案1】:
    UPDATE t
    SET m_code = l.m_code
    FROM test_s t
    JOIN OPENQUERY(linkserver,'SELECT conf_code, m_code FROM abcd.name_desk') l
    ON t.opr_code = l.conf_code
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-05
      • 1970-01-01
      • 2011-05-04
      • 1970-01-01
      • 2017-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多