Convert from char to decimal/int

  • Hi at all,

    i need to export a table where there is a

    column type char(10).

    I have to convert it in numeric(10) o int(10).

    in trasform windows of export there is

    DTSdestination("PIPPO")=DTSSource("PIPPO")

    I have to convert PIPPO from char(10) in decimal(10)

    In column PIPPO there is only numeric value

    and NULL/BLANKS value.

    In this case the procedure go in error about null/blank values.

    Can you help me ??

    Best regards Carlo

  • [font="Verdana"]Carlo, can you tell us, what exactly error you are facing?

    Mahesh[/font]

    MH-09-AM-8694

  • Istruction is :

    DTSDestination("PIPPO")=int(DTSSource("PIPPO"))

    Error is :

    Error Source=Run time Error ov Microsoft VBScript

    Erroe Description=Type non corrispond: [" "]

    Input = char(19) 10 blanks

    Output must be 0

  • paravia , blank string value cannot be implicitly converted to numeric value.

    SELECT CONVERT(int, '')

    will return an error

    What those blanks do actually mean?

    NULL? Zero? Something else?

    In any case update your source table in order to containt the correct data.

    Enforce some constraint on the table to prevent wrong data from being inserted in it in future.

    _____________
    Code for TallyGenerator

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

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