Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Key fields: alpha vs. numeric
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00318449
Message ID:
00321359
Views:
16
Dennis,
I just picked up on this thread.... We used character PKs in a large project, which rolled over to alpha (AAAAA) after they reached 99999. Both upper and lower case were used (AbCdE), and they worked GREAT - right up until we needed to put the archive data into SQL-Server. That's when we discovered that in 4 sites 2 had installed their SQL-Server with the "treat upper and lower case characters the same" default option and 2 had installed it to differentiate between upper and lower case. We had to change ALL the PKs and FKs (a major PITA) to match the existing SELECT statements. Next time, it'll be integer PKs and if I have to use str() for the few indexes that concatenate the PK or FK with another field so be it. The only place it's used now is when I want to order items in a grid (like invoice detail items) by date, and I have to convert the date with dtos() anyway.

Just my $.02 US.
Barbara

>I have long heard that numeric values in key fields improve performance (when key fields are relevant to the current operation). I have heard it enough from various (apparently) reliable sources that I believe it. My question is ( - in general and for VFP if there is a distinction):
>
>Is the benefit realized with numeric values in text/character type key fields or numeric type key fields? In other words, would I realize this benefit by using values composed only of 0-9 in a character type key field?
>
>To digress just a bit, I have always had a philosophical hang up with using numeric type fields for essentially non-numeric data? Crudely re-stated, I object to using numeric fields if no calculation would likely ever be relevant. In no cases that I have observed would a calculation be relevant on the values of key fields.
>
>Thanks.
Barbara Paltiel, Paltiel Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform