Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AutoIncrement Field and Duplicating Records
Message
 
 
À
03/08/2007 14:35:53
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01245869
Message ID:
01245878
Vues:
23
>>Another developer (currently on vacation) created a field (Claim) as an autoincrementing integer, to act as a primary key (the index itself is just a Regular, not Candidate). But now we are getting bad data, and the field values seemed to work okay for the first 25000 or so - and then reset to 1. So now there are are hundreds of bad records. So the last 800-odd records have duplicated claim numbers. The immediate question is, whether there is any way programmatically to determine what the next autoinc value is, and then how to reset it. The other question is how it got screwed up, and what to do to prevent it.
>
>Update: The ultimate question is, is there any way to programmatically tell what the next autoinc value will be? That's probably in the header somewhere, if I could read it I could then know whether a fix was necessary and where to start.

Is it a free table or part of a database?

if the later, you can put insert into table into transcation, get the id and rollback it.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform