Adding column of data to flat file to SQL table SSIS

  • If I have 4 columns on my flat file and I want to add a 5th column to populate for all rows with the text 'PC'

    Is it as simple as using the Derived column function on the Data Flow task and choose create new column and under expression enter "PC"?

  • That's certainly one way to do it! Depending on what you're doing - might also be a lookup (for data from another table) or data conversion (string-->numeric for example)

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Cool...ok then I will do that I was concerned about the expression field and simply entering just PC wouldn't work.

  • If you're just looking for the literal PC, then your expression just needs to be "PC" (with the quotes included). SSIS uses double-quotes, so using the snigle-quotes will get you an error as well.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

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

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