Hi Virgil,
<i><font color="#663300">Since each CB table requires a PK, would it be proper to use this number for item tracking or would it be more advisable to maintain a seperate number?</font></i>
There are a few who will disagree, but they are few. Even though each item in your database has a unique identifier required by the business rules, you should always have a surrogate primary key that the user *never* sees. Businesses often have the need to change the scheme of their unique identifier. I have several real-world examples where the lack of a surrogate primary key has caused me endless grief. Just recently we sold off a portion of our responsibility to a sister company. They want to use a different unique identifier than the one we have been using. Changing the unique identifier scheme breaks the links to all our transaction tables. I operate under the rule that I create a surrogate key for every table whether I need it or not, even many-to-many join tables. I am in the process of designing a rewrite of a system and I have already found the need to add three more fields to the many-to-many join table.
>>>If one were to use only the CB generated PK, would it be better to use interger rather than character?
I use integer because of speed and ease of use. I believe it is more a matter of personal preference than the issue of surrogate primary keys. If you choose a naming scheme that uses cID as the primary key of all of your tables, then being able to attach a prefix to the surrogate key that represents the table can be beneficial and would require character keys. I name my primary keys pk<tablename> so it doesn't matter.
HTH :-) Pamela pamela AT eagle-crest .DOT com ©2001 Pamela Thalacker |