convert string to int in ssis

  • Hi SSIS gurus,

    i am loading csv data into sql server 2005 database using ssis.in my csv file one column "primary key" is there it has data like this and it is string datatype

    Primary key

    ----------

    3.31E+11

    3.31E+11

    6.05E+11

    6.05E+11

    6.05E+11

    3.39E+11

    3.39E+11

    but in sql server 2005 database my column data type is "int"

    how to convert this using ssis

    any body help appricated

    thanks

    murali

  • SOrry, But from where I see is IMPOSSIBLE. "+" sign "E" char and "."

  • The "E" indicates either "Engineering Notation" or "Scientific Notation". The "E+11" means "Times 10 to the 11th power". It won't fit into an INTEGER, but it will fit into a BIGINT and conversion is simple...

    SELECT CAST(3.31E+11 AS BIGINT)

    ... etc, etc, etc.

    --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)

  • Hi Jeff thank u for answering

    i have one doubt where i have to write above Querie in SSIS.

    thanks

    murali

  • use a data conversion transform inbetwwen source and destination.

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

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