DreamGenius
Annoying Questionner
- Local time
- Today, 21:20
- Joined
- Jul 29, 2004
- Messages
- 116
Long story short, I've inherited maintaining a database in which the Primary Key on most of the tables is Autonumber.
Unfortunately, this database is used to collate data which is collected in clones of itself off-site, so I can't import data from the clones and maintain referential integrity, because the clones will use their own Autonumber sequence. At best, there'll be duplicates. At worst, there'll be mismatched joins!
The tables affected record medical practices and doctors at those practices. A subject therefore has a DoctorID recorded against their record, which pulls the Doctor from tblDoctors and the Practice from tblPractices, each Doctor in tblDoctors having PracticeID as a foreign key.
I'm inclined to replace the Primary Key in tblPractices with the post code (spaces removed) on the basis that there should not be any full post code in the UK with two practices on it. The Primary Key in tblDoctors would then be updated to the same post code plus a unique number per doctor.
This would enable me to import data from the subset databases without risking upsetting the referential integrity but can anyone see any flaws in this approach before I go off and louse it all up completely?
Apologies for the length of post.
Unfortunately, this database is used to collate data which is collected in clones of itself off-site, so I can't import data from the clones and maintain referential integrity, because the clones will use their own Autonumber sequence. At best, there'll be duplicates. At worst, there'll be mismatched joins!
The tables affected record medical practices and doctors at those practices. A subject therefore has a DoctorID recorded against their record, which pulls the Doctor from tblDoctors and the Practice from tblPractices, each Doctor in tblDoctors having PracticeID as a foreign key.
I'm inclined to replace the Primary Key in tblPractices with the post code (spaces removed) on the basis that there should not be any full post code in the UK with two practices on it. The Primary Key in tblDoctors would then be updated to the same post code plus a unique number per doctor.
This would enable me to import data from the subset databases without risking upsetting the referential integrity but can anyone see any flaws in this approach before I go off and louse it all up completely?
Apologies for the length of post.