Comparing Images in SQL

What is the best way to compare with images in a database? I tried to compare them (@Image is an image type):

Select * from Photos 
where [Photo] = @Image

But it gets the error "Image and image of data types are incompatible in an equal operator."

+3
source share
5 answers

Because the image data type is binary and a huge storage space, IMO, the easiest way to compare image fields is to compare hashes. Therefore, you need to save the hash of the "Photo" column on your table.

+9
source

, , . , . , . , , , , .

+1

, , .

, , . .

, 100100 , 5050 . ( ), .

, , :

, , ( , , ), MD5 .

+1

, . , DATALENGTH SUBSTRING READTEXT, . , CLR .

0

, . , . , , . 2 , 50% . , , .

, .

0

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