How to merge two databases to one

dealwi8me

Registered User.
Local time
Today, 04:13
Joined
Jan 5, 2005
Messages
187
I have a database with two tables, Buyer and Products, with one-to-many relationship. The key of Buyer is an autonumber ID, which is the foreign key to table Products.

The problem is that i have two copies of this database with different records (with ID starting from 1 to each one) and i want to merge the databases into one.

Any ideas how to do this without lose the connection of the records?

Thank you in advance.
 
You can append records to a table with an autonumber and populate the autonumber field so long as there are no duplicates.

So, what I would do is find the max value of the autonumber in the first db. Then go into the second db and change the current autonumber field in Buyer to number. Run an update query on Buyer to add the max value of the first db to the ID in Buyer. Do the same on the FK in Products. Then you can append the data in the two tables to the corresponding tables in the first db.
 
That works!

Thank you :)
 

Users who are viewing this thread

Back
Top Bottom