How can I update some of columns:
UPDATE Product
SET Title = REPLACE(Title , 'mn%', 'za%')
WHERE (Title LIKE N'mn%')
Consider data of one column is mnfmnd and must be changed to zafmnd
How can I update some of columns:
UPDATE Product
SET Title = REPLACE(Title , 'mn%', 'za%')
WHERE (Title LIKE N'mn%')
Consider data of one column is mnfmnd and must be changed to zafmnd
I would be inclined to use stuff() for this purpose:
update product
set title = stuff(title, 1, 2, 'za')
where title like 'mn%';
Try using STUFF as Sean suggested
update Product
set Title = STUFF(Title,1,2,'za')
where title like 'mn%'
create table #t (title varchar(16))
insert into #t (title) values ('abcdef'),('defghi')
UPDATE #t
SET title = stuff(Title , 1,2,'za')
WHERE (Title LIKE N'ab%')
select * from #t