SQL Server 2008の列をリンクサーバー(Oracle)テーブルから更新したい。 私はテーブルの列があります opr_code
, m_code
等 opr_codeに値があるSQL Serverテーブル内。
私は更新したい m_code
SQL Serverのリンクサーバー(oracle)からの共通の値 opr_code
それは 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
回答:
回答№1は0UPDATE 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