when i test my query like this
select REPLACE(REPLACE('Centrais Eletricas Brasileiras SA ',' AS ',' A/S '),'is','')
it removes the is from the text without adding A/S to anywhere were there is as in the text. but when i run my query it doesnt work.
this is the query
UPDATE dbo.SSCLXWorkingDataloadFile3
SET SecurityName = RTrim(LTrim(
REPLACE(REPLACE(' ' + SecurityName + ' ', ' '+ @StringToFind +' ', ' '+ @StringReplacement +' '), ''+@StringToFind +'', ''+@StringReplacement+'')
))
FROM dbo.SSCLXWorkingDataloadFile3
WHERE SecurityName IS NOT NULL
after the replacement you are trimming the string. That would not be the case. Please check with the data in table. It may have special character or Enter, Tab like that
if i take out the space around the AS THEN Brasileiras BECOMES BrasileirA/S which i dont want. only want the AS TO CHANGE TO A/S when its not part of a word