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
 
Top