>Tweaking one line here or there seldom makes for a quantum leap in performance. Only a different approach can do that. You'd need to outline the entire process.
Here is the outline.
In the stage tables we have new data from the client. There are 16 stage tables. We need to put information from stage tables into our database tables. We need to do various tests to see if we already have a Patient, if we already have this patient additional info such as phone or address, etc. The logic of the program is quite complex and was written by my colleague. I worked my way through the code, changed most of select statements to dbase code (so we would also get buffered info into consideration) and also changed multiple insert from memvar into insert fields approach. The speed seems to be the same or worse than it was though it's more correct from the logical point of view since the original code didn't always take buffered data into consideration.
Both programs are too long to post them here...
If it's not broken, fix it until it is.
My Blog