Nonfoldable User Defined Functions

Most SQL Server professionals know that wrapping a column in a function can kill SARGability. Far fewer realize that putting a user-defined function on the other side of the predicate can be just as dangerous. The reason isn’t the function itself. It’s...