Hi, can anyone point me to a function in MSSQL that returns the last index of a character in a string? I'm trying to find the base filename from a field that returns the full path.
Eg. if db contained rows:
C:\temp\file1.bat
C:\temp\Aug10\file2.bat
I would want as result:
file1.bat
file2.bat
The only solution I've come up with so far is to create a temporary table with the filenames, and recurse using update statements on the table until there are no more updates. There has to be a better solution.
|