I encountered something very strange in Microsoft SQL Server and basically it's something to do with the CHECKSUM_AGG(BINARY_CHECKSUM(*)) function.
Let's say that I have 2 different tables where the content is like this: 
As you can see, each table only has 2 possible row contents:
- 103 | Thomas
- 112 | NULL
However, they're still different because the second table has 5 of these row combinations but if I try to calculate the CHECKSUM_AGG(BINARY_CHECKSUM(*)) of the 2 tables by running
SELECT CHECKSUM_AGG(BINARY_CHECKSUM(*)) AS "Table 1 Checksum" FROM Table_1;
SELECT CHECKSUM_AGG(BINARY_CHECKSUM(*))AS "Table 2 Checksum" FROM Table_2;
They will display the same result:
This is very weird and I don't know why this is happening. I'm doing the CHECKSUM_AGG function to see if 2 tables have the same content and so far it looks like it's working quite well. However, in such rare cases where the 2 tables have similar content like those two above ^^, I'm afraid that the function will return the same result for the 2 tables.
Can someone please explain the reason behind this and if there's any way to mitigate this issue?
Thanks in advance and I would really appreciate any help :)
