Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Painfully Slow Monster Delete
Message
 
 
To
04/02/2010 09:39:48
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01447467
Message ID:
01447470
Views:
38
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform