Expression builder problem

  • All,

    Can anyone advise the correct way to put this expression together? I've tried a few combinations but each results in an error when I press OK. I don't think it's relevant but it's the "arguments" expression for an execute process task.

    SSIS expression builder

    Thanks

     

    • This topic was modified 4 years, 7 months ago by  as_1234. Reason: Grammar correction
  • What is SSIS saying it wrong with it? Also, please post the expression as text, rather than an image, so that we can at least copy and paste it.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • I just typed this in and it works fine, what error you getting?

    (DT_WSTR,255)("e C:\\Users\\as1981\\Downloads\\stackoverflow\\0302020 StackOverflow\\") + (DT_WSTR,255)( @[User::Filename])

    here is the result when i hit Evaluate Expression:

    e C:\Users\as1981\Downloads\stackoverflow\0302020 StackOverflow\ThisisMyFilename.txt

  • Both: Thanks for your help.

    Thom A: Sorry I didn't think of pasting as text. I will do in future.

    I've just compared AlphaTangoWhiskey's  example against mine and found the issue. It was the missing double backslashes in the path. I hadn't noticed they were missing but also wasn't looking at the content of the string as I thought that wouldn't be evaluated until runtime.

    Thanks

     

    • This reply was modified 4 years, 7 months ago by  as_1234.
  • Just a quick note - you may need to embed double-quotes into that string for it to work correctly.  There is a space in the path and it will probably cause an issue with execute process task and the parameter.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Thanks for the advice. You are correct I had to make further corrections. When I have access to the system again I'll post the final expression in case it helps anyone in the future

  • In relation to my previous post here is the final expression:

    "e \"C:\\Users\\username\\Downloads\\stackoverflow\\032020 StackOverflow\\" + (DT_WSTR,255)( @[User::FileName]) + "\""

     

Viewing 7 posts - 1 through 6 (of 6 total)

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