I had an old database with a single table containing customer orders and customer details. I went on to create a new database model using seperate tables for customers and details. I managed to migrate the customer details to the new database, but was unable to migrate the the cusomer orders. We thought that this would be ok, and that we would just build the order record from now on ignoring all previous orders in the old database. This was a while ago, and I cannot remember the exact reason why I was unable to import the customer orders. However, now we have discovered that we will need the old orders in the new database. Is there an easy way to do this using Microsoft Access?
This is the reason why:
Depending on how complex your schema is, a simple approach would be schema-mapping by a
INSERT INTO SELECTquery.For example if your old database had a table:
And your new database had fields with different names, extra fields, etc:
All you would need to do was to create an insert query to append the old records to the new table. In defining the query, you can specify the source and destination field names, and you can even perform functions / expressions on the data. You can even query on the other table directly, without linking or importing it into your new database:
If you have to do additional transformations to the data, such as run expressions on column values, I would recommend testing out the
SELECTpart of the query before adding theINSERTline.