Hope that title comes in.
I am comparing two fields: FieldA and FieldB. If my SQL looks like this:
it only returns rows if FieldA and FieldB are not null. If one or the other is null, the record is not returned. Now, using ISNULL I modified the query to look like this:
and the query does what I want. My question is: Why? Is this something to do with the collation I'm using? Is it a SQL Server default/bug/feature? Is there something I can do so that I don't have to use ISNULL? (Now that I've found it, I have a LOT of queries to rework)
I am comparing two fields: FieldA and FieldB. If my SQL looks like this:
Code:
SELECT pkKey, FieldA, FieldB
FROM Table1
WHERE FieldA <> FieldB
Code:
SELECT pkKey, FieldA, FieldB
FROM Table1
WHERE ISNULL(FieldA, '') <> ISNULL(FieldB, '')