Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Format fields as Text or Numeric
Message
From
15/03/2013 22:22:19
 
 
To
15/03/2013 22:20:16
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 7
Network:
Windows 2000 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01568565
Message ID:
01568566
Views:
47
>Question: if you have a columnn of unique numbers (ie: sku or sn), is it better to format that field as text or numeric?
>Thanks, Randy


Depends on several factors. Will you be using that key with other items? If so, then it's more straight-forward to maintain an index with something like:
INDEX ON sku+otherField TAG main
Than it is to do:
INDEX ON STR(sku,6,0)+otherField TAG main
Some people are die hard fanatics about always using integers for their unique/primary key fields. In my experience, it depends on the application, the nature of your data, the type of users/customers you'll have on the app ... many factors.

The short version is this: The solution has to make sense for the size and scope of the application. Designing a little system for an office staff of five people requires significantly different design strategies than does designing a system to work for Facebook.
Previous
Reply
Map
View

Click here to load this message in the networking platform