Friday, August 6, 2010

How to Extract Filename from Path

In SQL Server,
SELECT


REVERSE(
SUBSTRING(
REVERSE(FullFilePath),
0,
CHARINDEX('\', REVERSE(FullFilePath),0)
)
)
FROM FileSystem

In SSIS, use REPLACE (FullFilePath, Directory) to retrieve just the file name.

No comments:

Post a Comment