Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Msg 8152, Level 16, State 10, Line 3
String or binary data would be truncated.

What I have tried:

i have tried to fix it but not able to that.
Posted
Updated 25-Jun-20 23:58pm

1 solution

It's simple: it's saying that the string or array of bytes you have provided to an INSERT or UPDATE statement is too big for the column you are trying to write it to. For example, if your column is declared as NVARCHAR(5) and you try to INSERT "ABCDEF" you will get this error, while "ABCDE" will not fail.

We can't fix that for you: either enlarge the column to fit the data, reduce the amount of data you are passing, or check you are referencing the correct column.
 
Share this answer
 
Comments
Maciej Los 26-Jun-20 7:37am    
5ed!
Member 14552976 29-Jun-20 4:35am    
thanks man
OriginalGriff 29-Jun-20 4:48am    
You're welcome!
Member 14552976 29-Jun-20 4:57am    
can you help me store an image that has nvarcahr(max) datatype in sql?
OriginalGriff 29-Jun-20 5:09am    
No. See your most recent question:
https://www.codeproject.com/Questions/5272347/How-to-save-image-in-SQL-having-nvarchar-max-datat

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