>>>>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?
----------------------------------
António Tavares Lopes