Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Pull Gender
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01510820
Message ID:
01510828
Vues:
54
>>Your problem is in trying to do 'Catch all queries'. Rather than re-writing this query for you, I suggest you to take a minute to read these blogs to understand the best solution for the problem:
>>Do you use ISNULL(...). Don't, it does not perform - short blog by Denis Gobo
>> Dynamic Search Conditions in T-SQL Version for SQL 2008 (SP1 CU5 and later) - long and comprehensive article by Erland Sommarskog 
>> Catch All Queries - short blog by Gail Shaw
>>Sunday T-SQL tip: How to select data with unknown parameter set Nice blog by Dmitri Korotkevitch
>
>
>I didn't do it that way because I always thought that dynamic queries required a recompile each time and that was bad?

This is not correct. You can re-use the execution plan if you pass parameters into dynamic query properly. All the listed blogs explain in details how exactly you need to dynamically construct the query.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform