Data Types for Flat File import

  • Hi,

    I am trying to create an SSIS package for importing our mobile phone bill from a CSV file.

    Most of the field come in OK but the field with "CallTime" (Time the call was made)fails when choosing Datetime datatype. I realise it has no date in the field (example: 11:03) but not sure what type to choose other than string.

    Error 0xc02020a1: Data Flow Task: Data conversion failed. The data conversion for column "CallTime" returned status value 2 and status text "The value could not be converted because of a potential loss of data.".

    (SQL Server Import and Export Wizard)

    The same is true of the duration data (i.e length of time on call. Example: 02:36)

    Please Advise

    Thanks

    Jason

  • [font="Comic Sans MS"]

    I think choosing string is the correct way to go.. what is your destination table's data type?

    [/font]

    [font="Comic Sans MS"]--
    Sabya[/font]

  • zuma01 (12/6/2009)


    I am trying to create an SSIS package for importing our mobile phone bill from a CSV file.

    Why? Simple BULK INSERT will do much better especially for performance. Also, you should never target the final table on this type of thing. Always import the data to a staging table with VARCHAR datatypes so you can evaluate and validate the data before sending it to the final table.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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