>Hi Ray,
>
>>>>
>>>>DELETE FROM MyDataBase!OriginalClients ;
>>>> WHERE NOT DELETED() ;
>>>> AND clientID IN (SELECT clientID FROM ToRemove)
>>>>
>>>>And I had not indexed ToRemove in that attempt, so that's the next thing to try.
>>>
>>>I don't think you need to check for NOT DELETED(). Even if it deletes the second time, who cares?
>>
>>You don't, but that is supposed to trigger Rushmore optimization in DELETE SQL that doesn't use it otherwise. Unfortunately, the index on ToRemove made no difference: it shows a query progress bar to 12% and then appears to hang. I suspect it will complete if I let it go for long enough, but neither I nor my customer has that long to wait.
>
>You don't need the WHERE NOT DELETED() for Rushmore to work. You just need an index on DELETED().
The following is cut and pasted from "Hacker's Guide to Visual Foxpro."
"Even when there's a tag on DELETED(), DELETE-SQL doesn't check the tag unless you include the clause NOT DELETED() in the
WHERE clause. Amazing. If the clause is included, you get a Rushmore-ized delete."
The copy I have goes back a few years, so it's possible later versions of VFP changed the rules.
Ray Roper