Our team is curious about the architecture of tablediff utility. We want to find the difference between table rows.
Microsoft mentions tablediff here, however does not state how it works. Does tablediff take the checksum or hash of every row and compare tables? What is the internal algorithm method?
https://learn.microsoft.com/en-us/sql/tools/tablediff-utility?view=sql-server-2017
create table dbo.CustomerTransaction
(
CustomerTransactionId int primary key,
CustomerName varchar(50),
ProductName varchar(50),
QuantityBought int
)
Using tablediff example:
So row values Table 1: (1,'Bob','Table',8)
is the Same as Table 2: (1,'Bob','Table',8)
These are different (1,'Bob','Table',8)
, (1,'Bob','Chair',8)
, different on the primary key.
I know it requires the source table to have primary Key/Identity/rowguid column to compare, and was originally based on replication technology.