Import from spreadsheet and overwrite existing

Broker666

Registered User.
Local time
Today, 13:12
Joined
Dec 13, 2012
Messages
26
Hi,

Basically I have a macro that runs the TransferSpreadsheet action to import data from an Excel file. As it stands if the field containing the primary key already exists it will flag an error message and not import that record. What I want to do is overwrite the current record with the new record from the Excel file in any instances where it already exists in the table. Any suggestions regarding the best way to go about this?

Regards,

B666.
 
Any help would be much appreciated. What I basically want to do is import data from a spreadsheet and if it already exists (based on the primary key value) overwrite it. If data in the table does not exist in the spreadsheet I want it to remain there. Most of the solutions I have come across involve clearing the table and them re-importing but this is not what I want to do.
 
I would import to a temp table and do the update. Join the temp table to the data table and match the PK's to perform the update. Then run the append from the temp table to the data table
 

Users who are viewing this thread

Back
Top Bottom