Comparing Columns that can contain NULLS - is there a more elegant way?
You can use this approach from Paul White's article Undocumented Query Plans: Equality Comparisons
SELECT *
FROM A
INNER JOIN B
ON A.ID = B.ID
AND EXISTS(SELECT A.*
EXCEPT
SELECT B.*)
Standard SQL, supported in SQL Server 2005 and better:
WITH A_MINUS_B
AS
(
SELECT *
FROM A
EXCEPT
SELECT *
FROM B
)
SELECT *
FROM A_MINUS_B AS T
JOIN B ON T.ID = B.ID;