Hi @harinathu ,
Welcome to Microsoft Q&A!
Please refer below:
select pid, SUBSTRING(productname,1,CHARINDEX('p',productname)-1) + 'z'+SUBSTRING(productname,CHARINDEX('p',productname)+1,len(productname)-CHARINDEX('p',productname)) productname
from productdetails
OR
SELECT pid,STUFF(productname, CHARINDEX('p', productname), 1, 'z') productname FROM productdetails
Output:
pid productname
1 cinzhol
2 azple
3 zpens
4 zenrpos
Best regards
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.