How to compare image data types in SQL Server

I am having trouble writing select statements to compare two values ​​in t-sql that are of image type. This is what I still have:

SELECT a.UserId, b.UserId
FROM [dbo].[aspnet_Profile] as a inner join [dbo].[aspnet_Profile] as b on
    (a.UserId = <some string> AND b.UserId = <some other string>)
WHERE BINARY_CHECKSUM(a.PropertyValuesBinary) = BINARY_CHECKSUM(b.PropertyValuesBinary)

But I keep getting error messages no matter what I do in the WHERE clause. For the above request, an error message appears:

Error in binarychecksum. No comparable columns in binarychecksum input.

Anyway, any help would be greatly appreciated. It’s very difficult for me to do something with this data type, for some reason ...

By the way: I am using SQL Server Web (I think this is the 2008 edition) ...

Thank!

Andrew

+3
source share
2 answers

binarychecksum

BINARY_CHECKSUM . , ntext, , , xml (CLR) .

http://msdn.microsoft.com/en-us/library/ms173784.aspx

MD5 . , , binary_checksum !

+1

?

   select BINARY_CHECKSUM(A.PropertyValuesBinary) from aspnet_Profile as A

#s .

0

Source: https://habr.com/ru/post/1771334/


All Articles