Hi ...
I am currently using a similiar method in order to compare data. The Hash value is calculated as follows:
HashBytes('SHA1',
UPPER(Isnull(convert(varchar(max), Branch), ''))
+ UPPER(Isnull(convert(varchar(max), VendorID), ''))
+ UPPER(Isnull(convert(varchar(max), VendorName), ''))
+ UPPER(Isnull(convert(varchar(max), VendorTradingName), ''))
+ UPPER(Isnull(convert(varchar(max), RegisteredCompany), ''))
+ UPPER(Isnull(convert(varchar(max), TypeOfEntity), ''))
+ UPPER(Isnull(convert(varchar(max), RegistrationNumber), ''))
+ ........ <other columns>
)
I convert each field to varchar datatype and concatenate them together in order generate a value.
Do you see any problems with this approach?
Also, I checked the length (using Len()) of the Hash Value and the max length I have so far is 20. I have the column that holds the Hash Value as datatype varbinary(max). Should I change the size of this column?
Thanks in advance.