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

xmlapi
  • 11
  • 1

1 Answers1

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.

Anti-weakpasswords
  • 1,716
  • 10
  • 13