hash a SQL row?

后端 未结 4 581
情歌与酒
情歌与酒 2020-12-29 23:32

Is there a way to md5sum a row in a SQL table to check whether any column has been modified?

I would like to check whether any particular column has been changed ver

4条回答
  •  悲&欢浪女
    2020-12-30 00:01

    There are CHECKSUM(*), BINARY_CHECKSUM(*) and CHECKSUM_AGG. They do CRC32 like checkum, but for detecting changes to a row it should be more than enough (you are talking about 1 in 4 billion chances for a false negative collision).

    Doing a cryptographic hash using HASHBYTES requires you to construct an expression representing the 'row'.

提交回复
热议问题