开发者

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

开发者 https://www.devze.com 2023-02-02 00:01 出处:网络
I have uploaded an image and stored into 开发者_开发知识库image field in database, that image is stored as 0xFFD8FFE. When I am trying to update the above with null as getting an exception called:

I have uploaded an image and stored into 开发者_开发知识库image field in database, that image is stored as 0xFFD8FFE. When I am trying to update the above with null as getting an exception called:

The datatypes image and varbinary(max) are incompatible in the equal to operator

I want to change the above value to null.


Just set it to null with an update statement:

UPDATE dbo.MyTable
  SET MyFieldName = NULL
  WHERE MyPrimaryKey = 12345


update organisation set logo= null where logo like 0xFFD8FFE00010

0

精彩评论

暂无评论...
验证码 换一张
取 消