Click here to Skip to main content
14,579,188 members
Rate this:
Please Sign up or sign in to vote.
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.
Updated 25-Jun-20 23:58pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
Maciej Los 26-Jun-20 7:37am
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:

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100