Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Performance question
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00680632
Message ID:
00686780
Vues:
46
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"
>
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform