CHARINDEX('Mars', 'The stars near Mars are far from ours') : CHARINDEX « String Functions « SQL Server / T-SQL






CHARINDEX('Mars', 'The stars near Mars are far from ours')


1> -- 
2>
3> SELECT CHARINDEX('Mars', 'The stars near Mars are far from ours')
4>
5> GO

-----------
         16

(1 rows affected)
1>
           
       








Related examples in the same category

1.CHARINDEX: returns the starting point of the first occurrence of one string of characters within another string
2.CHARINDEX(): find the first occurrence of a substring within another string
3.CHARINDEX: Get index of the delimiting space
4.Combine CHARINDEX with substring