Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Surrogate Keys - Have I got the right idea
Message
De
12/01/2001 02:43:59
Walter Meester
HoogkarspelPays-Bas
 
 
À
11/01/2001 19:09:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00434523
Message ID:
00462816
Vues:
21
Hi mark,

I don't think your proposal is neccesary and might cause problems when deleting a certain record twice.

If in your case, the deleted records in the target table is the only problem, I think by filtering the PK on deleted() will solve your problems nice and clean.

Just give it a test: Open the target table exclusively, open it in de table designer (MODIFY STRUCTURE), go to the indexes tab, select the primary key, and type: !DELETED() in the filter column.

For rushmore optimizations reasons, add another regular index on the primary key: (For example: INDEX ON MyPrimaryKey TAG PK2 )

No just try what you're trying to do again.

Hope this helps.

Walter,

>How does this sound as a solution to my updating problem using surrogate keys.
>
>To avoid getting an update problem I convert the PK in my target table to a minus amount. I then delete the record and cascade any deletes that are neccesary if more tables are involved.
>
>Because the deleted records in the target table now have a different PK I can append in my new records (which contain the original positive PK)
>
>I realise that this can be a bit inefficient in some circumstances but I can think of a lot of circumstances where it would be the simplest way.
>
>Assigning a minus PK to deleted records would also have the advantage of allowing me to start recycling deleted records again like I did in the old days.
>
>Am I about to make a big mistake .
>
>Please let me know
>
>Thanks:)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform