Hello,
I would like to import data from two tables, which are 1-many related, from database.A to database.B.
Primary Key is an autonumber field.
Is there a way to do it to keep referential integrity between the tables?
Thank you for hints.
Hello,
I would like to import data from two tables, which are 1-many related, from database.A to database.B.
Primary Key is an autonumber field.
Is there a way to do it to keep referential integrity between the tables?
Thank you for hints.
Do you want all the records or is this a selective import?
Why is this necessary? This will be a repetitive procedure, meaning you have to do this on a regular basis?
Last edited by June7; 01-11-2015 at 03:04 AM.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
All records are to be imported.Do you want all the records or is this a selective import?
I want to combine a few (~8) databases of the same structure into one.Why is this necessary? This will be a repetitive procedure, meaning you have to do this on a regular basis?
This is a task that will be done only once, so I can do it manually. My only concern is the autonumber field used for PK.
Can be done.
Do the 1-side tables in each of the dbs currently use autonumber PK?
Import the records so that the original PK/FK data are saved into a regular number type field in both tables. The records of the 1-side will receive new PK. After each import, populate a field in each table with a source identifier (A, B, C, D, E, F, G, H) for that set of new records. Build a query that joins the tables on the old PK/FK values and the source identifier and update the new PK into another field of the many-side table.
Once everything looks good, can delete the old PK/FK fields as well as the Source fields.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Works.
Thank you.
Small remark. During this operation "Enforce referencial integrity" must be (at least temporary) disabled, because it is not possible to append records to the table on many side if there is no PK the appended records can refere to.