The below code find text by this name Segment Detail. if found then change the old xfundcode with new xfundcode. full code given. so many charindex which cr