Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Repeated records
Message
De
02/08/2007 09:06:45
 
 
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 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01245292
Message ID:
01245450
Vues:
23
>>This is the easiest, and probably the best way to do this.
>>
>>Update yourtable set field1=data1, field2=data2,...;
>>  where uniqfield1=uniqdata1 and uniqfield2=uniqdata2 and uniqfield3=uniqdata3
>>if _tally=0 && No records found, so this is a new record
>>  Insert into yourtable (field1, field2... , uniqfield1, uniqfield2, uniqfield3);
>>    data (data1, data2, ... ,uniqdata1, uniqdata2, uniqdata3)
>>endif
>
>Looks like a good idea.
>
>What if we work with buffered tables? We may still need a candidate index.

Regarding buffered tables, I am not sure, but it has never been an issue for me. Since three fields are involved, you would need a surrugate key as a candidate index, I don't like surrugate keys.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform