列具有varbinary(max)但引发异常“值违反MaxLength限制”

时间:2016-10-05 04:55:51

标签: c# sql varbinary

我们有一个名为“Images”的数据库,这个表有“ImageData”[varbinary(max)]列和其他一些列。

现在,当尝试添加图像的二进制值作为“ImageData”列的值时,会引发以下异常:

An exception of type 'System.ArgumentException' occurred in System.Data.dll but was not handled in user code

Additional information: Cannot set column 'ImageData'. The value violates the MaxLength limit of this column.

如果尺寸为“max”,这怎么可能?

其他信息:

SELECT DATALENGTH(ImageData)
FROM OurDatabase.dbo.Images

返回大小为500000的最大图像,因此低于2GB(varbinary max)

0 个答案:

没有答案