Sample Header Ad - 728x90

HASHBYTES() result of another HASHBYTES(), OR CHECKSUM_AGG() aggregate for HASHBYTES()?

1 vote
1 answer
762 views
I want to aggregate a single HASHBYTES() from the results of another HASHBYTES()... something like CHECKSUM_AGG() does for CHECKSUM()... I have been able find how to make a single HASH per row of columns from a table: SELECT hashbytes('MD5', ( SELECT SPECIFIC_SCHEMA ,SPECIFIC_NAME ,ROUTINE_SCHEMA ,ROUTINE_NAME ,ROUTINE_TYPE ,ROUTINE_DEFINITION FROM ( VALUES (NULL) ) foo(bar) FOR XML auto )) AS [Hash] FROM INFORMATION_SCHEMA.ROUTINES AS MBT; How do I aggregate to a single hash from all the hash rows returned? (Yes, I want to reduce a table to a single hash for comparison to table(s) in other databases).
Asked by Ricky Lively (54 rep)
Jul 21, 2022, 11:33 PM
Last activity: Jul 22, 2022, 12:09 AM