1

We're moving all our on premise tables into the azure dedicated sql pool. We're using synapse workspace pipelines to import the data into the dedicated pool.

Is there a way to checksum a table to compare it against on premise table to make sure everything was imported correctly? I know in SQL Server there is a checksum function for a table but apparently it is not in

1 Answer 1

0

Inside SQL option: IF the data is small enough in the tables, AND you're on SQL 2016 or later (when HASHBYTES has a VARCHAR(MAX) input, not VARCHAR(8000) as in SQL 2014 and before) you can take a select, use FOR XML, and feed that value into HASHBYTES.

SELECT 
HASHBYTES('SHA2_256', (SELECT ID as a, name as b, address as c FROM Table1 ORDER BY primarykey FOR XML AUTO))

THIS IS INEFFICIENT AND SLOW.

Outside SQL option: use sqlcmd or bcp or whatever tool you like to dump the entire table out to disk in primary key order from each system, and then compare the results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.