Actually, the fastest way is to run SQLExec only against ready-to-use (compiled) back-end stored procedure.
>Hi David ---
>
>In some cases, SQLPREPARE can be a lot faster than just SQLEXEC. As far as SQL Server goes, I believe that SQLPREPARE compiles the query into SQL's memory cache of procedures. SQLEXEC alone does this and then executes.
>
>>>
>>>I was wondering...
>>>
>>>What's the difference between using:
>>>
>>>1) The SQLExec with the embedded query string
>>>2) The SQLprepare with the query string followed by an SQLExec
>>>
>>>The help mentions that SQLPrepare send the query string for
>>>compilation by the ODBC data source. This compiling is not
>>>mentionned for the SQLExec command.
>>>
>>>Does this mean that SQLExec without an SQLPrepare will
>>>run my queries slower ?
>>>
>>>Or is it just a question of personal choice?
>>>
>>>TIA
>>>
>>>Pascal
>>
>>My understanding of SQLPrepare is that it is that it compiles the SQL statement and creates the plan. Then when you run the SQLExec it will just run the plan.
Edward Pikman
Independent Consultant