Click here to Skip to main content
15,915,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
String or binary data would be truncated.
The statement has been terminated.
Posted

What it means is that somewhere you are using INSERT or UPDATE to alter data in a database, and the data you are providing is too big to fit in the field.
For example, you may have a NVARCHAR(10) column, and trying to INSERT an 11 character username. Or is may be an BINARY(100) field that you are trying to UPDATE with 256 bytes.

We can't tell - we can't see your code, can't run your website, and don;t have access to your data or database. So look at the error message, look at the line that it occurs on, and then add logging to examine what the actual data is (or use the debugger). It may be you are passing the wrong data, you need to validate your inputs, or you have simply declared the column too short.

Sorry, but we can't do any of that for you!
 
Share this answer
 
This exception occurs when your datatype size does not match with database field attributes.
As you haven't shared your code, db structure, I'd say you need to solve it on your own. ;)

-KR
 
Share this answer
 
This error raises because of the exceed the size limitation, for example your datatype size is 10, but you are trying to insert more than that size in that scenario you may face this type of errors.

To Avoid this you need to increase the size of your datatype or you should enter the appropriate size into that field.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900