I am self taught with SQL Server. I been using the replace script lately. I have to replace a string inside of a varchar column.
An example of what I need to change is 15151500001500000000 where I need to change the last 00 to 10
This is the script I am using:
UPDATE xxxxx
SET craftname = REPLACE(craftname, 00, 10)
WHERE craftname like '%00'
However it gives me this error every time
String or binary data would be truncated.
I searched around the net and from what I can see most common reason is that the column is getting to big but here I am replacing 2 digits with 2 digits so that shouldn't happen.
Any ideas?
REPLACE(craftname, 00,10)SQL server allows that? I'm guessing it converts the integers to strings and then uses them in the replace operation. so you getREPLACE(craftname, '0','10')which is probably not what you want.