We've got this whole mess trying to export data from Lotus Notes to
Great Plains. As part of the process, we need to ensure that a Notes
record is exported only once, but have the ability to re-export it if
something breaks. So, for that reason (and some others) I decided to
use a simple log table:
create ExpLog (
ExpDateTime Datetime not null,
DBID varchar(16) not null,
docUNID varchar(32) not null,
)
So, the code records the records datetime, and the DBID and docUNID
(which uniquely identifies every Lotus Notes "record"). My question is
in the sql that exports the records. Which is likely to be more
efficient?
select
field1,
...
from LotusNotes LN left outer join ExpLog EL on LN.DBID = EL.DBID and
LN.docUNID = EL.docUNID
where EL.docUNID is null
or
select
field1,
...
from LotusNotes LN
where
ln.DBID not in (select DBID from EL)
and
ln.docUNID not in (select docUNID from EL)
How would one go about figuring this out assuming that the SQL is going
into a DTS package. (I think that means the plan isn't saved?)
Thanks.