Item.sql erro String or binary data would be truncated.

08/17/2019 20:23 ShaiyaIwanttolearn#1
I noticed this error in the query, when inject in my database, presents several lines of errors, I tried to correct straight in the item.sdata replacing the item configuration, or attempts of Erase Item, but the error continues, does anyone have any solution? for this?

Code:
Msg 8152, Level 16, State 14, Line 50
String or binary data would be truncated.
The statement has been terminated.
Msg 8152, Level 16, State 14, Line 51
String or binary data would be truncated.
The statement has been terminated.
Msg 8152, Level 16, State 14, Line 52
String or binary data would be truncated.
The statement has been terminated.
Msg 8152, Level 16, State 14, Line 53
String or binary data would be truncated.
The statement has been terminated.
08/17/2019 20:45 sominus#2
One of the values you're inserting is bigger than the field width.

Example: You have a varchar(5) field, and you try to insert 'aaaaaaaaaa', that string won't fit in 5 chars.

May be some item's name is too long to fit in ItemName field.
08/17/2019 20:55 ShaiyaIwanttolearn#3
Quote:
Originally Posted by sominus View Post
One of the values you're inserting is bigger than the field width.

Example: You have a varchar(5) field, and you try to insert 'aaaaaaaaaa', that string won't fit in 5 chars.

May be some item's name is too long to fit in ItemName field.
I checked the error items, and deleted the items, but the errors are still on the same line.
08/17/2019 21:42 sominus#4
You could run just the block that gives the error (delete the lines before and after). Try modify strings in those lines, etc to find where the error comes from. Just remember to make a copy of the Items table before (in case something goes wrong)
08/17/2019 23:48 ShaiyaIwanttolearn#5
Quote:
Originally Posted by sominus View Post
You could run just the block that gives the error (delete the lines before and after). Try modify strings in those lines, etc to find where the error comes from. Just remember to make a copy of the Items table before (in case something goes wrong)
I removed all error lines, and the error still exists even though I leave the line blank

Code:
Msg 8152, Level 16, State 14, Line 39
String or binary data would be truncated.
The statement has been terminated.
Msg 8152, Level 16, State 14, Line 50
String or binary data would be truncated.
The statement has been terminated.
Msg 8152, Level 16, State 14, Line 51
String or binary data would be truncated.
The statement has been terminated.
Msg 8152, Level 16, State 14, Line 52
String or binary data would be truncated.
The statement has been terminated.
Msg 8152, Level 16, State 14, Line 53
String or binary data would be truncated.
The statement has been terminated.
Msg 8152, Level 16, State 14, Line 63
String or binary data would be truncated.
The statement has been terminated.
Msg 8152, Level 16, State 14, Line 23
String or binary data would be truncated.
The statement has been terminated.

(1 row(s) affected)
Msg 8152, Level 16, State 14, Line 33
String or binary data would be truncated.
The statement has been terminated.

(1 row(s) affected)
Msg 8152, Level 16, State 14, Line 35
String or binary data would be truncated.
The statement has been terminated.

(1 row(s) affected)
Msg 8152, Level 16, State 14, Line 13
String or binary data would be truncated.
The statement has been terminated.
Msg 8152, Level 16, State 14, Line 14
String or binary data would be truncated.
The statement has been terminated.
08/18/2019 05:29 sominus#6
Try posting one of those lines
08/19/2019 00:38 sominus#7
You have a few items with name longer than 30 chars.
Example: 'Símbolos de Colecionador da Luz (150)' has 37 chars long, and ItemName field only allow 30 chars. You have to make the item name shorter.

Also you have accents (áéíóú), so you would need to change te collation for your Items table, to support accents.

Right click Item table, choose DESIGN, go to 'Column Properties', search for 'Collation' and change it to 'Latin1_General_CI_AI'
And try to run the script again (it worked for me).

REMEMBER to make a backup or copy of the Items table before any changes.
08/19/2019 06:55 ShaiyaIwanttolearn#8
Quote:
Originally Posted by sominus View Post
You have a few items with name longer than 30 chars.
Example: 'Símbolos de Colecionador da Luz (150)' has 37 chars long, and ItemName field only allow 30 chars. You have to make the item name shorter.

Also you have accents (áéíóú), so you would need to change te collation for your Items table, to support accents.

Right click Item table, choose DESIGN, go to 'Column Properties', search for 'Collation' and change it to 'Latin1_General_CI_AI'
And try to run the script again (it worked for me).

REMEMBER to make a backup or copy of the Items table before any changes.

Problem fixed, really was that, thanks

This topic can already be closed.