3

I am trying to solve a unique problem. Thanks for any help with this.

Is there an easy way to generate some kind of a hash code for a record based on several of its field values?

I thought about just creating a view with an extra column that concatenates all of the values that I want to check, but I'm checking to see if there is a better way.

I am trying to identify records based on their values, because I need to group parent records by the uniqueness of these child records, if that makes any sense.

Thanks again for any advice.

1 Answer 1

8
SELECT
    HASHBYTES('MD5', CAST(col1 AS VARBINARY(MAX)) + 
        CAST(col2 AS VARBINARY(MAX)))
FROM
    mytable
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.