get only filename from variable

  • Hello all,

    i have a SSIS package with a for each file loop.

    I use a uservariable user:filename, now the actual name (for instance 110.csv) is the 110. This name i want to use as a derived column into a table, but I can't find out how I only can get this string (110) in a separate variable, I know i probably should use a expression but that's all what i can think of. Is there anyone who can give me a hint or solution to this?

    Thanks in advance,

    Peter

  • If it's always .abc (period, 3 letters) then you can just do this..substitute with column name if selecting from a table or CTE.

    select left(fieldorvariable,len(fieldorvariable)-4)

  • thanks derek, for the quick response and answer. I give it a try immediately and will let you know.

    Peter

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

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