Can anyone explain the actual working of CharIndex() function in SQL Server. I have gone through MSDN and other websites. But I got few doubts after reading those. I am able to understand with 2 parameters. But I am not able to understand output once we use the third parameter(Start position)Please see the below examples.
SELECT CHARINDEX('t', 'TechOnTheNet.com', 3);
-- Result: 7
SELECT CHARINDEX('t', 'TechOnTheNet.com', 8);
-- Result: 12
I am not able to understand why the results like that for the above two.