Comparing image data types in SQL

How to compare Image data types?

I need to compare the file stored in the database with the downloaded file. But he says Image comparison is not possible. I even tried to convert to nchar

 (CONVERT(char(1000), FileData) 

Can anybody help me?

+4
source share
1 answer

Do not use the image data type, which is deprecated.

Instead, use the varbinary(max) replacement data type, which does not have all the restrictions image

In the meantime, you can cast(FileData as varbinary(max)) to allow comparisons.

+12
source

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


All Articles