>Hello.
>
>I have a little problem with creating indexes. I don't really
>know what's right or not. Here is the problem:
>
>1. I have a table which has a field that is the PK.
> I insert a record and puts the value "1" in the PK-field.
>
>2. Then I mark the record for deletion.
>
>3. I insert another record and puts the value "1" in the PK-field.
> VFP will reject the added record because of key uniqueness
> violation.
>
>How can I solve this in a right way, so I don't miss out the rushmore
>optimization. I have tried the following but I'm not sure if this is
>the way to do it, and how can one use candidate indexes?
>
>INDEX ON pk_field TAG tab_pk PRIMARY FOR !DELETED()
>INDEX ON pk_field TAG field
>INDEX ON DELETED() TAG tab_del
>
>/Magnus Nordin
Magnus,
Instead of inserting values by hand to a PK field create a PKgenerator routine and set the default value of field to that value (ie:PKfielddefval=myPKgenerate(cTable,cType)). For an easier way you could try using sys(2015) as a default value for a PK field char(10).
Cetin