How to Compare Image
data types?
I need compare a file stored in DB with an uploaded file But it says that comparing Image
data type is not possible I even tried to convert to nchar
(CONVERT(char(1000), FileData)
Can anyone help me?
The IMAGE data type in SQL Server has been used to store the image files. Recently, Microsoft began suggesting using VARBINARY(MAX) instead of IMAGE for storing a large amount of data in a single column since IMAGE will be retired in a future version of MS SQL Server.
How to view images stored in your database Start SQL Image Viewer and connect to your database. For SQL Server databases, tables containing blob columns will be highlighted in green in the list of database objects. Write the query to retrieve your images, and execute the query.
SQL Server allows storing files. In this article, we learned how to insert a single image file into a SQL Server table using T-SQL.
Don't use the image
datatype it is deprecated.
Instead use the replacement datatype varbinary(max)
which does not have all the limitations of image
In the meantime you can cast(FileData as varbinary(max))
to allow comparisons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With