Answer: CHARINDEX is an in-built Sql Server function that accepts two arguments.The first argument is the character which are being searched for and the second parameter is the original string expression.It will return the first index position that the character passed into the first argument which is present inside the string expression.
Syntax:-
CHARINDEX (string_char_to_find,string_char);
For Ex:-
SELECT CHARINDEX(' ','Hello World');
Here,
H = 1,
e = 2,
l = 3,
l = 4 and so on.
Asked In: Many Interviews |
Alert Moderator