What is the output of below code?

declare @str navrchar(50);
set @str = 'Rajesh Kumar';
Select Replace(@str,'Kumar','Sathua') as 'New Value';

 Posted by Rajesh_Kumar on 1/21/2014 | Category: Sql Server Interview questions | Views: 1109 | Points: 40
Answer:

Output would be Rajesh Sathua.As we know that Replace function replace the text from given string.Here 1st expression is rajesh kumar,i want to replace kumar with sathua,so i will pass kumar in 2nd parameter and new value will be passed in 3rd parameters.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response