Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Same Query, Different Performance with Variables
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01509595
Message ID:
01509604
Vues:
38
>>What is the point of such strange code? Why not take the count into a variable first and then add it as a field whatever number you need?
>>
>>In addition, the problem you're facing is called parameter sniffing. Check Plamen Ratchev article
>>
>>Parameter Sniffing
>>
>
>What is the point? No point... just a bad query by a dumb programmer. Sometimes I get stuck in a certain mindset and forget about things like including a sql select as a field in the query (See Sergey's sample code). Thanks for the link, I am reading about Parameter Sniffing now.

You're welcome. I didn't notice that you were using different tables at first. In any case, that code surely looked weird to me.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform