escape characters for \ and _ in concatenated expressions

  • The SSIS expression builder fails validation whenever I concatenate 'underscores' or 'slashes'.

    For example, this fails validation: @[User::BaseDate] + '_' + @[User::BaseFile] +'\'

    My workaround is to create 2 additional variables @[User::Underscore] and @[User::BackSlash] defaulting their values to _ and \ respectively then rebuilding the expression as:

    @[User::BaseDate] + @[User::Underscore] + @[User::BaseFile] + @[User::BackSlash]

    Is anyone aware of special escape characters which I can use in place of these 2 additional variables?

    BT
  • The underscore should not need an escape character. Double up the backslashes to get one into an expression string.

    "S:\\" + "_TestFolder" gives S:\_TestFolder

  • thx.. yep, all I had to do was enclose the underscore in double quotes... and double up the \\ within double quotes.. worked great !!

    BT
  • Thanks for your post.

Viewing 4 posts - 1 through 3 (of 3 total)

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