Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Performance question
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00680632
Message ID:
00686789
Views:
49
Well, that was just for my example, If you use an ad-hoc query will it be faster if you concat the string together vs letting VFP insert the variables for you.

ex

"select * from sometable where id = '" + lcID + "'"
vs
"select * from sometable where id = ?lcID"




>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"
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform