>HI,
>Do you prefer to use Integer value or STR(Integer value) as primary key ?
>
>Thank you
To assure uniqueness in a single integer field, I would just create a candidate index on the single field - no str(), which would simply add overhead, which I believe is unnecessary in this case.
To assure uniqueness in any other single field, I would also use the field itself.
To ensure uniqueness among two or more fields, the simplest method is usually to everything to character, and concatenate (use "+" to combine the character expressions).
For integers, it turns out that bintoc() (VFP 5 or later) takes up much less space than str().
An example, involving a character, an integer, and a date:
index on MyCharacter + bintoc(MyInteger) + dtos(MyDate) tag MyIndex
dtos() is suitable for dates, since it is independent of the date format.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)