Automatically remove table from append query

L

LH

After runing an append query I want the (from) table to be removed to help
prevent creating duplicate records the next time the query is run.
 
J

John W. Vinson

After runing an append query I want the (from) table to be removed to help
prevent creating duplicate records the next time the query is run.

Do you want to *remove the table itself* - all the data *and* the structure?
Or do you just want to empty the table, deleting all the records which were
added?

I'd prefer the latter, which can be done easily using a delete query

DELETE * FROM sourcetable;

or, better, to prevent deleting records which didn't append

DELETE sourcetable.*
FROM sourcetable
INNER JOIN targettable
ON sourcetable.primarykeyfield = targettable.primarykeyfield;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top