I have an entity with a binary datatype and a corresponding varbinary(max)
column in SQL Server. EF creates this:
CREATE TABLE [dbo].[Attachments]
(
[Id] INT IDENTITY(1,1) NOT NULL,
[FileName] NVARCHAR(255) NOT NULL,
[Attachment] VARBINARY(MAX) NOT NULL
);
When I try to call .SaveChanges()
from Entity Framework, I get an error:
Cannot create a row of size 8061 which is greater than the allowable maximum row size of 8060
I understand the error, there's plenty of that on Google but I don't understand why I'm getting it. Shouldn't this be managed by Entity Framework / SQL Server?
Richard
The only way I can see you getting this error with that table definition is if you have previously had a large fixed width column that has since been dropped.
Which Gives
If this is the case then try rebuilding the table