When I was working on the C/S book, I noticed that if you use the parameters, VFP/ODBC generates the call to sp_executesql but if you don't, VFP/ODBC creates a batch w/o it.
I'm not sure what the speed difference will be or even if there will be a difference. sp_executesql's job is to try to cache the query plan for ad-hoc queries. I see no benefit to calling a stored proc through sp_executesql.
-Mike
>"try sending the stored procedure with the parameters as literals in the commandstring. IOW, don't use VFP's ability to parameterize the commandstring."
>
>So your saying that this:
>
>"exec moveStudentIn '"+ lcStudentID + "', '"+ lcHall +"', "+ lcRoom +", '" + lcDate + "', "+iif(lbToSingle,'1','0')+", "+alltrim(str(piCurrentPeriod))
>
>is faster than this:
>
>"exec moveStudentIn ?lcStudentID, ?lcHall, ?lcRoom, ?lcDate, ?lbToSingle, ?piCurrentPeriod"
>