Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Surrogate Keys - Have I got the right idea
Message
De
11/01/2001 20:32:34
 
 
À
11/01/2001 20:19:11
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:
00462715
Vues:
16
>So, the next question is..... Why bother? Just leave the PK alone, and generate an entirely new one for the new record. What's the problem with that???? Or did I miss something here. :/

I would then have to update all the child tables with the new PK and all the tables in any associated apps with the new PK across a very slow WAN.
Thats the problem that got me started on this thread in the first place.

My problem kinda got lost in a debate about Surrogate v Intelligent keys.

I prefer surrogate keys for most apps now. Its just that not being able to do a delete/append was getting to be a problem. I ended up writing lots of seperate update routines just to get a few records into one of my tables. I think this approach will work pretty well for me now.

Unless folks here can tell me otherwise:)



>>Thanks Fred:)
>>
>>>SET Devil's Advocate ON
>>>So now what happens if someone deletes the new positive value DK record again?
>>>SET Devil's Advocate OFF
>>
>>
>>Well the system crashes causing thousands of pounds worth down time of course.
>>
>>DOH!
>>
>>Lol...I spotted that one seconds after I pressed the send button.
>>
>>Ok then....how about we stick with minus values for deleted records but have a new minus generated PK for each deleted record.
>>
>>So in my nextkey table I have a key called PK_DELETED and it returns a unique minus PK for any record I delete.
>
>So, the next question is..... Why bother? Just leave the PK alone, and generate an entirely new one for the new record. What's the problem with that???? Or did I miss something here. :/
>
>>BTW what hourly rate is the Devil offering these days:)
>
>< B evil G >
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform