I created a database to assist in analyzing the contents of an Excel spreadsheet (provided by a third-party contract). The format of the data in the spreadsheet is denormalized to look something like the following:
Parent1ID Parent1Name Child1ID Child1Name
Parent1ID Parent1Name Child2ID Child2Name
Parent1ID Parent1Name Child3ID Child3Name
Parent2ID Parent2Name Child1ID Child1Name
Parent2ID Parent2Name Child4ID Child4Name
It's important to note that the ChildIDs are NOT unique.
This was not a problem initially because I was able to import the entire worksheet into a single table and then run queries to populate the Parent and Child tables.
HOWEVER, they are now introducing "versioning" in a way that is causing a problem for me. When a new version is being created, they repeat the Parent and ALL of the Child rows, but only put the versioning information on the FIRST Child in the group. (They refuse to repeat the versioning information on all of the rows). So the data now looks like the following:
Parent1ID Parent1Name Child1ID Child1Name EffectiveDate1
Parent1ID Parent1Name Child2ID Child2Name
Parent1ID Parent1Name Child3ID Child3Name
Parent1ID Parent1Name Child1ID Child1Name EffectiveDate2
Parent1ID Parent1Name Child2ID Child2Name
Parent1ID Parent1Name Child3ID Child3Name
Parent1ID Parent1Name Child5ID Child5Name
Parent2ID Parent2Name Child1ID Child1Name EffectiveDate1
Parent2ID Parent2Name Child4ID Child4Name
I MUST relate all of the Child rows for a particular version to the correct version of the Parent, but have not been able to come up with any idea of how to do so.
Does anyone have suggestions on how to approach this problem?
Parent1ID Parent1Name Child1ID Child1Name
Parent1ID Parent1Name Child2ID Child2Name
Parent1ID Parent1Name Child3ID Child3Name
Parent2ID Parent2Name Child1ID Child1Name
Parent2ID Parent2Name Child4ID Child4Name
It's important to note that the ChildIDs are NOT unique.
This was not a problem initially because I was able to import the entire worksheet into a single table and then run queries to populate the Parent and Child tables.
HOWEVER, they are now introducing "versioning" in a way that is causing a problem for me. When a new version is being created, they repeat the Parent and ALL of the Child rows, but only put the versioning information on the FIRST Child in the group. (They refuse to repeat the versioning information on all of the rows). So the data now looks like the following:
Parent1ID Parent1Name Child1ID Child1Name EffectiveDate1
Parent1ID Parent1Name Child2ID Child2Name
Parent1ID Parent1Name Child3ID Child3Name
Parent1ID Parent1Name Child1ID Child1Name EffectiveDate2
Parent1ID Parent1Name Child2ID Child2Name
Parent1ID Parent1Name Child3ID Child3Name
Parent1ID Parent1Name Child5ID Child5Name
Parent2ID Parent2Name Child1ID Child1Name EffectiveDate1
Parent2ID Parent2Name Child4ID Child4Name
I MUST relate all of the Child rows for a particular version to the correct version of the Parent, but have not been able to come up with any idea of how to do so.
Does anyone have suggestions on how to approach this problem?