>I have:
>
>Table1 (large table with over 50,000 records)
>
>table 2 (always a small table with 100 records or less)
>
>I want add data of table 2 to table 1
>
>if field table2.device_id already exists on table1.device_id
>
>= messagebox (Record already exists)
>
>What is the best way to do such append ?
You can select records that already exist into a cursor and insert records that don't exist, e.g.
select table2.device_ID from table 2 inner join table1 on table2.device_id = table1.device_id into cursor curExistingRecords
Process this cursor to show your messagebox
insert into table1 select * from table2 left join curExistingRecords cur on table2.device_id = cur.device_id where cur.device_id IS NULL && to insert only new records
If it's not broken, fix it until it is.
My Blog