I have a string \'some.file.name\',I want to grab \'some.file\'.
To do that,I need to find the last occurrence of \'.\' in a string.
My solution is :
A very simple way is:
SELECT RIGHT(@str, CHARINDEX('.', REVERSE(@str)) - 1)