Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is more efficient of the two
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01135592
Message ID:
01135629
Views:
9
>Hi Borislav
>
>>It is very hard to say w/o proper testing. I would vote for second if you first issue SQLPREPARE() to prepare your query first and then in loop just change parameters and issue SQLEXEC(), BUT as I said, I am not so sure that this is the faster way.
>
>So an SQLEXEC() (w/o a SQLPREPARE) containing the same SQL statement (but different parameters) will be slow inside the loop. But if the same thing is SQLPREPAREd() before the loop it will give a better performance, if then the SQLEXEC() is called in the loop?

If you SCAN through relatively small ammount of records maybe the difference in speed will not be visible, if you have many ecords in SCAN I expect this to be faster because your query is compiled at SQL Server side and SQL Query optimizer is already done its job and after you issue SQLEXEC() its just follow the execution plan. But as I said this is only my expectations.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform