Link to home
Start Free TrialLog in
Avatar of javier-d
javier-dFlag for United States of America

asked on

String or binary data would be truncated.

We converted a SQL field from NText to NVarChar(Max), the conversion went smoothly, but recently when our programs do a record update, we began to receive the message "String or binary data would be truncated." We checked the length of the new data for this field, and it is longer than the original values but it is way smaller than the 4,000 character maximum, we think that the problem is due to the fact that the field record is located at the end of a disk page boundary, and SQL can not extend the length of the field, our solution to this was delete the record and insert a new one with the new data.

We are currently using MS-SQL 2016, the table was created in MS-SQL 2005.

We are looking for a more smooth solution or a fix to this problem.
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Where are you updating from ?

Doesnt sound like a SQL Server problem as such. As Scott says, even 4000 characters is a doddle for NVARCHAR(MAX)

must be procedural
Avatar of javier-d

ASKER

We  found out the problem, was related with an Update trigger, with the wrong size.

Thanks.