I have 2 tables. Table 1: Source that is in Oracle cloud and Table 2: in sql server 2016 on prem server. We have a request to update the on-prem data with cloud data based on some joining column(s). Question is how do i update via open query on prem data without landing the cloud data into my on-prem server. In test case I have few thousand rows but in reality there are close to 44M rows in cloud source. That said tech example and what I have tried thus far.
SELECT *
into #On_PremTable
select *
FROM OPENQUERY([111.222.555.999/PXX],'select *
from trac where rownum <= 500');
this works.
update #On_PremTable
set ARTCEXR = c.ARTCEXR
,ARTGEST = c.ARTGEST
FROM OPENQUERY([111.222.555.999/PXX],'select *
from trac where rownum<= 500 ') as c
join #On_PremTable as a on a.ARTCINR = c.ARTCINR
also works. But how to I check or update rows on the #On_PremTable when they are few thousand or even Millions. Is there a way for me to put #On_PremTable part of open query so this join , in lack of words happens on the cloud side, and only update or pull back a small result-set to update rather than few thousand or 44M records.