Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Primary Keys when deleted can't be reused untill pack
Message
De
07/05/2000 04:46:13
 
 
À
06/05/2000 20:06:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00367026
Message ID:
00367062
Vues:
13
>How are developers handling the problem where a primary key and data record is added to a table. The user decides to start the record over so they delete the record. When they start to add the record again with the same key, they will get a duplicate key message because the key, although deleted, is still in the index, until I pack the file. One idea would be to change the key when I delete the record. Is there a better approach anyone is using.

Don't recirculate primary keys - once you've assigned a primary key, it's gone and no longer usable, even if you never actually post it through. In most cases, I'd use a surrogate key - an artificial key used only for relation handling - and discard it even if it nver posted to the table.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform