John/Sorin
I've tried both your methods and the plot thickens, not because of the results but because of how much the results generally differ from yesterdays.
Sorin, your result was the quickest, however this was only replacing one (specific) field, in the real app that wouldn't be the case. John, your's was just a bit quicker than the SCATTER/INSERT method, however, we are only talking about a millisecond here. Just a note, there were 1092 records appended in total.
What interests me is the results from yesterday are so much different, today the average if around 1.369 in VFP, however yesterday it was 1.83. The C# app is consistent, it's as it was yesterday, so it's as if the OLE DB is more consistent, but that's weird, I would've thought that maybe the local network was faster today, maybe it's something else. I did run yesterdays test later in the day, it's now morning where the n/w traffic won't be very high.
Oh well, I'm confused now, I'll run it again later and see what it's like.
Kev
>Kevin,
>
>I agree, it sounds remarkable that OLEDB seems quicker than local tables, that certainly isn't the party line!
>
>Of course, there is more than just SQL going on here. How many fields/records are there? That SCATTER MEMVAR...INSERT loop could be pretty inefficient if there are lots of fields and/or rows. Why not replace it with
>
>
>Select results
>Append from DBF('test')
>
>
>You might also consider USE ... NOUPDATE NOREQUERY though I doubt that has much to do with it.
>
>Finally, I believe both the OLEDB and native VFP will "cache" tables between queries, sometimes yielding much quicker queries the second time around. I'm wondering whether it is possible to correct for this in your C# version?
>
>Regards
>
>j.R