June 14, 2010 at 3:17 pm
If I wanted to derive the file name from a path in T-SQL, I would use the following:
LTRIM(RTRIM(REVERSE(SUBSTRING(REVERSE(b.filename),0,CHARINDEX('\', REVERSE(b.filename), 0)))))
However, I don't think there is a CHARINDEX function in SSIS. So what would be the SSIS equivalent to get the job done?
June 14, 2010 at 3:51 pm
Refer to find a list of various SSIS functions
http://technet.microsoft.com/en-us/library/ms141671.aspx
in particular - FINDSTRING
June 14, 2010 at 4:26 pm
Thanks to you, I think I'm gaining an understanding of Findstring, except for one thing: how do figure out the LAST occurrence of the "\" character within the string?
June 15, 2010 at 3:03 am
Reverse the string, find the first occurrence in the reversed string and then subtract that from the total string length ...
June 15, 2010 at 1:16 pm
Phil Parkin
Reverse the string, find the first occurrence in the reversed string and then subtract that from the total string length
And here is a link that explains the REVERSE function
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply