Using SQL Server 2014.
I have a field that contains a string that contains a full file path i.e.
\\Server\Folder1\Folder2\Folder3\File21.csv
I only want what is after the last backslash i.e.
File21.csv
So in the world of SQL I would use:
Select RIGHT([FileName],charindex('\',reverse([FileName]),1)-1) as FileNameNew from mytable
However, how do I do this in a Derived Column in SSIS? There is no CHARINDEX so you have to use FINDSTRING. This is my expression:
RIGHT( [FileName] , FINDSTRING('\', REVERSE( [FileName] ) ,1) -1)
But it is not working, it keeps saying the single quotation mark was not expected. I've also tried double quotes to no avail.