Changing importing data

  • I am importing data from a comma dilimited file in to an "employee" table. All employee numbers begin with 0. I want to import the employee number and convert the 0 to the letter X. Is this a two step Process? Help thanks.

  • I got it to work. Use a transformation of type VB Script and use the string manipulation in the example below. This assumes the length of the string is constant. and only the 1st 0 is replaced with x. If this is incorrect, I can help tweek it. (Replace 5 with 1 less than the length of the employee number)

    '**********************************************************************

    ' Visual Basic Transformation Script

    '************************************************************************

    ' Copy each source column to the destination column

    Function Main()

    'Append x with right 5 characters of Number

    s = "X" & Right( Cstr(DTSSource("EmplNum")), 5)

    DTSDestination("Col001") = s

    Main = DTSTransformStat_OK

    End Function

    Darren


    Darren

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

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