I must to check if two values, X and Y are different. If both are null, they must be considered as equal.
The unique way I found is:
select 1 as valu
I think you could use COALESCE for that
WHERE coalesce(@X, '') <> coalesce(@Y, '')
What it does it returns an empty string if one of variables is null, so if two variables are null the two empty strings become equal.
null