Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary index
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00720081
Message ID:
00720087
Views:
12
>I have a table that has a Primary index. Within my app, once I year I need to copy a selected number of records out of this table to a temp table, I then make some global changes to several fields in the temp file, then I need to append these records back to the original table.
>
>Before I even tried this the first time, I knew I was going to get a "Uniqueness of Index is violated" VFP error, and I did.
>
>Anyone have an idea of the best way to handle a situation like this? Is there a way to easily turn off the primary index, do the append, rebuild a unique ID, then turn the primary index back on.
>
>Any thoughts are appreciated.
>
>Mel Cummings

If you do that maintenance job with full (exclusive) access, you may delete and rebuild the primary key index with:
DELETE TAG MyField
...
ALTER TABLE MyTable ADD PRIMARY KEY MyField TAG MyField
You could also (with exclusive access) delete the bunch of records, PACK and reappend the same keys.

Regards,
------------------
Jose Marcenaro
Tercer Planeta - Argentina
http://www.tercerplaneta.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform