Script Data Conversion

  • Hi

    I am new to VB.net script..I want to write a script which helps me in data conversion..

    Eg

    1)Data conversion from byte to String

    2)String[Dt:Str] non unicode to String[ST_Wstr]Unicode

    3)String to Integer

    I have to do  this with Script only..

    Thank you

    dilsa

     

  • My question is why?  SSIS has a data conversion task that you can use to complete the data conversions you require without writing any scripts.

  • hi..thanks for your reply..

    i am using Data conversion task ...buts its not able to convert

    Byte Stream [DT_BYTES] to String[DT_STR]

    It gives this error:

    [Data Conversion [245]] Error: Data conversion failed while converting column "DATA" (2466) to column "Copy of DATA" (2878).  The conversion returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".

    So i was thinking using script for this kind of conversion.

    His there any other solution to convert bytes to string..

    please help me with this problem

  • It might help if you could provide some sample data and what your trying to convert it to.

  • hi..

    I am tyring to convert numeric eg 20070518

    TO

     datetime or smalldatetime eg 5/18/2007 12:00:00 AM

    in Dts package ther wrote this script..

    but i dont know how can i do in SSIS package

    Function Main()

    DTSDestination("DataLancamento")=Mid(DTSSource("BODATL"),1,4) & "-" & Mid(DTSSource("BODATL"), 5,2) & "-" & Mid(DTSSource("BODATL"), 7, 2)

    Main = DTSTransformStat_OK

    End Function

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

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