How to get the position of a character from a word in SQL server.
For this there is a function call CHARINDEX(). This is very similar to InStr function of VB.NET and IndexOf in Java. This function returns the position of the first occurrence of the first argument in the record.
This would return 3 as it is start from 1.
SELECT CHARINDEX('r','server')
This would return 3 as it is start from 1.
Comments
Post a Comment