Data Conversion task and data types

  • I posted this the other day in a different forum but I think it was the wrong forum. Anyways,

     

    I'm creating my first SSIS package and I have yet to fully understand the data conversion.

    I have a table with a single varchar(75) column.

    And example would look like this

    4032555445552215555333

    I need to grab some substrings and convert them to integers and a couple to just string type data.

    With t-sql I would usually just CAST(SUBSTRING(Data,16,1) As Int) AS ColumnName

    for each integer type column. For the string data I just use SUBSTRING(Data,10,2) AS ColumnName.

    With a Derived Column task I am trying to do the same thing. I have tried several different expressions but I am not having any luck. The destination table has data types nchar and int.

    What expressions would I use?

    Thanks!

  • Try this (regarding the integer type column)

    (DT_I8)SUBSTRING(Data,16,1)

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

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