xdream (1/28/2010)
So why not use something like "ISNULL(IntValue1, -1) = ISNULL(IntValue2, -1)" for every case where IntValueX has to be >-1? I guess this would be faster than calling a function.
How does that work if -1 is a valid value in the column? 😉
(IntValue1 <> IntValue2) OR (IntValue1 IS NULL AND IntValue2 IS NULL)
...is one correct way to test this type of condition. Just one more reason to avoid NULL values wherever possible.
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi