none
how to convert varchar to integer in ssis

    Question

  • I have  a source table with coulmn name phone_no with datatype as varchar(15).

    In destination table the datatype equivalent to this column is integer.

    for example if i have phone_no as 919009998886662 ,then what type of conversion I need to use so as to match with the target data type

    I tried to execute but I got this kind of error

    "Invalid character value for cast specification".

     "Conversion failed because the data value overflowed the specified type."

    please help me on this


    fuzailrashid
    Tuesday, November 16, 2010 5:42 AM

Answers

All replies

  • this value can not be Integer, It is much bigger than int

    but you can convert it to decimal with a data conversion transformation or with derived column transformation with this expression : (DT_DECIMAL,0 )InputColumn


    http://www.rad.pasfu.com
    Tuesday, November 16, 2010 6:20 AM
    Moderator
  • You have to change the datatype in the destination table to either Varchar(and directly insert the values without doing any conversion inside SSIS) or Decimal (if you are following the Reza'a suggestion).


    Nitesh Rai- Please mark the post as answered if it answers your question
    Tuesday, November 16, 2010 7:14 AM