I have a problem where I have a table that contains some data and another table with an identical structure and the same data as the first, with additions. (For example, if Table A has dog, cat and rat, Table B has dog, cat, rat, cow, horse and snake...)
My question is, how do I design a query that will add the missing records from the second table into the first table without giving me errors? My SQL query comes back with warnings about Key violations.
This is a copy of the SQL statement:
INSERT INTO defn_system ( system, system_desc, auto_fill_inventory, system_only, trade_shop_id )
IN 'C:\Documents and Settings\rgibson\desktop\AMMS\AMMS2006.mdb'
SELECT natinv.SYSTEM, natinv.DESC, natinv.AUTOFILL, natinv.SYSONLY, TRADE.TRADE
FROM natinv LEFT JOIN TRADE ON natinv.TRADE = TRADE.TRADE
WHERE (((natinv.SUBSYSTEM) Is Null Or (natinv.SUBSYSTEM)=''))
ORDER BY natinv.SYSTEM;
This code scans the NATINV table for any records that have an entry in the SYSTEM field but not one in the SUBSYSTEM field and outputs that record. I'm trying to seperate th SYSTEM records and put them in their own table (defn_system), but that table already has some of the records from NATINV. I'm trying to append Defn_system with the others.
GOD is in charge, though men may say, "Not so!
My question is, how do I design a query that will add the missing records from the second table into the first table without giving me errors? My SQL query comes back with warnings about Key violations.
This is a copy of the SQL statement:
INSERT INTO defn_system ( system, system_desc, auto_fill_inventory, system_only, trade_shop_id )
IN 'C:\Documents and Settings\rgibson\desktop\AMMS\AMMS2006.mdb'
SELECT natinv.SYSTEM, natinv.DESC, natinv.AUTOFILL, natinv.SYSONLY, TRADE.TRADE
FROM natinv LEFT JOIN TRADE ON natinv.TRADE = TRADE.TRADE
WHERE (((natinv.SUBSYSTEM) Is Null Or (natinv.SUBSYSTEM)=''))
ORDER BY natinv.SYSTEM;
This code scans the NATINV table for any records that have an entry in the SYSTEM field but not one in the SUBSYSTEM field and outputs that record. I'm trying to seperate th SYSTEM records and put them in their own table (defn_system), but that table already has some of the records from NATINV. I'm trying to append Defn_system with the others.
GOD is in charge, though men may say, "Not so!