I have data in column like 'www.abc.com/inbox/../../' and I need to replace it with 'www.xyzw.com/box/inbox/../../' , have total 1500 rows starting data with 'www.abc.com/inbox'. Now I need to update all the 1500 rows with 'www.xyzw.com/box/inbox' and remaining part of URL should be same with an update statement.
SET col1 = REPLACE(col1, SUBSTRING(col1, charindex('www.abc.com/inbox',col1),17), 'www.xyzw.com/box/inbox') where col1 like '%abc%';
but I am getting error like data is being truncated. I am using SQL SERVER 2000.
Thanks for the reply. but col1 has varchar(255) datatype and the URL has 140 characters. but if I update the record individually like put col1=condition its working perfectly fine. When I put like operator in where condition, facing this error.