SSIS expression return only file name part.

  • I would like to create a variable fileName in SSIS package using an expression, basically I would like to return the file name from the qualified name.

    How can I do that? I think i should use string function to extract from below, but not knowing how to do that.

    Below string is also a variabe called FullFileName

    \\servername\F$\backup\DBname\mydb_backup_2013_10_27_013056_6413097.bak

    Thanks

  • Declare a newvariable called Filename and in the expression builder use the below expression it will give you fileName

    REVERSE(SUBSTRING(

    REVERSE ( @[User::FullName] ),FINDSTRING(REVERSE ( @[User::FullName] ),".",1)+1,FINDSTRING(Reverse( @[User::FullName]),"\\",1)- FINDSTRING(Reverse( @[User::FullName] ),".",1) -1))

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply