June 21, 200520 yr I was watching a video at Petrowsky's site and he said that every table should have as it's first field, a number field labled ID, auto enter serial number. My question is: is this necessary in child records? What is the purpose of doing this? Toffler
June 21, 200520 yr As the sign in a nearby cemetery says, "Better to have and not need, than to need and not have." I would not say that it needs to be a number field, I prefer text. Every table should have a primary key.
June 21, 200520 yr This is usually true, but I think saying "every table" is too much of a generalization. Join tables don't necessarily need a primary ID. "Value list" tables may not need them. The reason why you should not put them in tables where they are not needed is because of imports. It sometimes happens that you have to import existing records into a new version, etc.. In that case you only want to have to reset serial IDs where necessary, the less the better. I know Ralph is into separation of data (which is something I need to learn more about), so he wouldn't have this problem so often. I would say "almost every table." Whether a child table needs one or not depends on whether you're going to be processing each one of the child records at some point. Usually you are, so you need an auto-enter serial ID to be able to positively identify a particular child record. Schemes you commonly see in businesses, using numbering calculations, the "next" job number, etc., have their use (mostly to keep the client happy :-), but are not as reliable.
Create an account or sign in to comment