简体   繁体   中英

Inserting missing records from Oracle DB into SQL Server database

I have an Oracle database with a table Customers to which I only have read-only access. I would like to copy some columns from this table and insert them into a SQL Server 2008 R2 table called Customers , only when the ID does not exist in the destination table.

I'm new to C#.... I can open and read from Oracle successfully using Oracle.DataAccess and I can write to SQL Server, but I am lost on how to read from Oracle then write into SQL Server. All the examples I could find are for databases of the same type.

I wanted to follow up on this to share that despite many creative solutions offered here and elsewhere, there was not an efficient enough way to accomplish this task. In most every case, I would have to read the entire contents of two very large tables and then check for missing records without the performance advantage of a true join. I decided to go with a hybrid model where the app obtains basic information from the main Oracle database and then reads and writes the supplemental information in and out of SQL Server .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM