Undocumented Query Plans: Equality Comparisons

Posted by Paul White on SQL Blog See other posts from SQL Blog or by Paul White
Published on Tue, 21 Jun 2011 15:58:46 GMT Indexed on 2011/06/21 16:28 UTC
Read the original article Hit count: 396

The diagram below shows two data sets, with differences highlighted: To find changed rows using TSQL, we might write a query like this: The logic is clear: join rows from the two sets together on the primary key column, and return rows where a change has occurred in one or more data columns.  Unfortunately, this query only finds one of the expected four rows: The problem, of course, is that our query does not correctly handle NULLs.  The ‘not equal to’ operators <> and != do not evaluate...(read more)

© SQL Blog or respective owner

Related posts about internals

Related posts about query plans