Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Painfully Slow Monster Delete
Message
 
 
À
04/02/2010 09:39:48
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 7 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01447467
Message ID:
01447470
Vues:
36
>There is a primary index on clientid in the original table and numerous dependencies. So your second method is worth a try. I had considered just deleting the files and using COPY TO from the ClientsToKeep cursor, but the thought of recreating all those indexes was pretty daunting. Thanks for the tip; helped clarify my brain plaque.
>
>>IMHO, the simplest way would be
>>
>>select OC.* from OriginalClients OC LEFT JOIN TORemove TR on OC.ClientID = TR.ClientID where TR.ClientID IS NULL
>>into cursor ClientsToKeep
>>
>>delete all from OriginalClients
>>select OriginalClients
>>** pack -- would be nice to pack 
>>insert into OriginalClients select * from ClientsToKeep
>
>>
>>(this assumes you don't have primary/candidate index on ClientID in OriginalClients table and don't have dependents).
>>
>>If you do, you can
>>
>>delete all
>>
>>recall for ClientID in (select ClientID from ClientsToKeep)
I'm not 100% now sure the second method will work. Does the delete trigger fire when you mark record for deletion (I assume it does). If so and you have RI defined (with CASCADE delete), you may not use the second method either :(
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform