I have to fetch data from a @temp table which has something like \"or ccc or bbb or aaa\" I want to replace the first occurrence into space to get something like this \" ccc
it seems you miss 2% preceding and trailing to the target string
%
please try:
select STUFF(@stringhere, PATINDEX('%' + @stringtofind + '%', @stringhere), LEN(@stringtofind), ' ')