Insert Recored

S

Shariq

I have two tables; TableA and TabelB. There are some records in TableB that
do not exist in TableA, how do I write a query to update TableA so the
records from TableB are inserted in TableA?
 
O

Ofer

Try this:
INSERT INTO TableB
SELECT TableA.*
FROM TableA LEFT JOIN TableB ON TableA.FieldName = TableB.FieldName
WHERE TableB.FieldName Is Null

in the field name you should specify the unique value that will be in one
table but wont be in the other

Or you can use the query wizard to create on for you, by selecting the query
that return the un match values, and then change the query from select to
append
 

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