I'm quite new to coding in general and I'm looking to copy 47 columns with c300,000 rows of data, from an Oracle to an SQL database, on a daily basis. The code will be stored as a Windows Service, running at the same time every day (or more likely night).
The data from the Oracle DB table (let's call this the Oracle_Source
) will be used to both append to a history table (call this SQL_History
) and also to append new/update matching/delete missing rows from a live table (call this SQL_Live
). The two types of databases are housed on different servers, but the two SQL tables are on the same DB.
I have a few questions around the best way to approach this.
Using VB/C#, is it faster to loop through rows (either 1 by 1 or batches of 100/1000/etc.) of
Oracle_Source
and insert/updateSQL_History
/SQL_Live
OR copy the entire table ofOracle_Source
in one go and insert into the SQL tables? Previously I have used the loop to download data into a.csv
.Using the more efficient of the above methods, would it be faster to work on both SQL tables simultaneously OR copy the data into the
SQL_History
table and then use that toAPPEND
/UPDATE
/DELETE
from theSQL_Live
table?Am I approaching this completely wrong?
Any other advice available is also much appreciated.