How to update varbinary with null value in image field in SQL Server 2008?

I uploaded the image and saved it in the image field in the database, this image is saved as 0xFFD8FFE. When I try to update the above with zero as getting an exception called:

Image and varbinary (max) data types are incompatible in the equality operator

I want to change the above value to zero.

+2
source share
2 answers

Just set it to null with the update statement:

UPDATE dbo.MyTable
  SET MyFieldName = NULL
  WHERE MyPrimaryKey = 12345
+3
source

organization update set logo = null where logo as 0xFFD8FFE00010

+1
source

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


All Articles