SSIS Expression to Obtain Filename from Path

Cool post to find the Filename portion of a path that includes the filename.   Simply replace zFilename in two locations in the example below with the name of your user defined variable name.  This user defined variable must contain the full path including the filename.   Create another user defined variable to store the filename portion of the string, then assign it this expression:


REVERSE(SUBSTRING(REVERSE( @[User::zFilename] ), 1, FINDSTRING(REVERSE( @[User::zFilename] ),"\\", 1)-1))

Works a treat!

http://beyondrelational.com/modules/2/blogs/106/posts/11125/ssis-expression-to-get-file-name-from-file-path.aspx

About AussieBICG

Connect with me here https://au.linkedin.com/in/aussiebicg

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s