Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>In general, you should never have a situation where you are attempting to insert a duplicate unique key. You can make sure of this by maintaining a table of keyvalues for your tables and call a routine to get the next available keyvalue for a particular table. If you want to reuse deleted records you can set deleted off and scan for the first deleted record, then do a recall and replace all the fields except the key or whatever else you want to keep. If there are no deleted records available, get a new keyvalue and insert.
We're using tables with compound keys and
restructuring the entire database is not an
option. Actually, the index that's confounding
me at this point is a compound candidate key.
How in efficient would it be to add
TRANSFORM( DELETED())
to an index tag? I don't like it, but it may
be what I'm looking for.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement