Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IIF equalent in T-SQL
Message
 
 
À
07/08/2016 03:52:44
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:
01639207
Vues:
67
>>>>>A quick note: "Column = @Param OR @Param IS NULL" is not the same as "@Param IS NULL OR Column = @Param".
>>>>
>>>>Why? It is exactly the same.
>>>
>>>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.
>>
>>This is not how MS SQL works query optimizer works. The order of conditions makes absolutely no difference.
>
>Wow, it seems you're right.
>
>By any chance, the value of @Param can be changed during the SELECT?

No, the value of @Param is not going to change in SELECT unless you have it like this

select @param = [some column] from ...
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