[thelist] SQL: finding "new" records in a table

Judah McAuley judah at wiredotter.com
Tue Sep 4 12:04:36 CDT 2007

Fred Jones wrote:
> I would consider connecting directly to the main DB yourself every hour 
> and loop through an SQL result set, instead of the CSV.

For a variety of fascinating reasons, this isn't really an option. It is 
a great suggestion, however.

> I am no expert over here, but I would suggest that the only alternative 
> is of course to compare the records, that is the CSV record versus your 
> DB record, to see if an update is necessary or not.

Agreed. My question then, is what is the most efficient way to do this? 
I could load the csv file into a temp table and then find all the rows 
that need inserts pretty easily via a join.

What of the other rows though? What is the most efficient way to see if 
two rows are identical for 12 columns?


More information about the thelist mailing list