Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF equalent in T-SQL
Message
De
07/08/2016 14:36:15
 
 
À
07/08/2016 03:23:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01639189
Message ID:
01639209
Vues:
95
>
>For MSSQL's sake, I hope it isn't!
>
>When the first condition is true, the second is not tested. So, in the second expression, if @Param IS NULL there is no need to check on Column's value.

PMFJI (and I think from subsequent posts you now realize it), Naomi is right.

I'm oversimplifying this a bit, but it's because the SQL Server optimizer takes a "safe route" when building an execution plan. So Naomi is correct, it makes no difference. The "issue" here is that a compiler for an application language (like C# or VB) will look at the conditions and the order they appear - SQL Server's optimizer won't.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform