Table field revision

eacollie

Registered User.
Local time
Yesterday, 16:12
Joined
May 14, 2011
Messages
159
I have inherited a database with, among other tables, one table of rooms and one table of room reservations history.

For some reason the table of room reservations history has a foreign key to the room name, not the room "unique ID" (primary key).

What would have been the reason for doing this? Changing the relationship to foreign key/primary key involves changing a large number of reports, etc.

Thanks much!
 
It might take extremely thorough testing to ensure the change was complete, especially if the name is text and the ID is numeric.

If the room name is unique and not alterable by any user then I would say "best leave sleeping dog lie."
 
I agree with the sentiments about leaving it alone if it's working.

But to address your question about "why", I would guess that the original designer was not competent. A numeric PK/FK must win but I acknowledge that in a small system, the performance hit is negligle.
 

Users who are viewing this thread

Back
Top Bottom