Jump to content

create relationships before or after data import??


This topic is 5750 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi there,

When I design my database and create some relationships between tables, should I do this before or after importing data?

If I already have data in my table, will the relationship be made properly when I insert data in another table?

Tnx in advance for the help,


Link to comment
Share on other sites

It all depends on what you expect the relationship to do.

Can you be a little more specific...maybe tell us what your database is for and the perspective(s) from which you'd like to view your data?

Link to comment
Share on other sites

My simple recommendation would be to create the relationships first. My reasoning for this is that you can set up your interface to use the relationship to automatically insert the related ID into your child record, but only if the relationship is there already. This means that any new records that get added through the interface will get the correct ID as they are created.

As for importing records, if the respective ID numbers are in the right places (Note: this can be a BIG if!), then the relationship will be "made" correctly. A relationship just tells the software that "If I am looking at Purchase Order #17, please show me all the LineItem Records that have 17 in the fkPurchaseOrderID field."

Looked at this way, it doesn't matter what the match fields are, or how they arrived at their content--it just matters that they match.

Now, the big IFs: when you import into your tables, your parent ID has to get into your child records. This is no big deal if they're already there (for example, you're upgrading an older database). But if you're creating new ID numbers in the parent table, then you have to find a way to get that ID into the right field in the child records.



Link to comment
Share on other sites

This topic is 5750 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.