Convert SSIS data from varchar to int

Asked

Viewed 591 times

0

I’m locked into a conversion by SSIS, scenario:

I have a CSV file, which I need to import into a table already created in the database, In this table of the database I have a column already populated that receives data type INT, I noticed that there are records with up to 9 characters in this column.

I am trying to convert the data of this CSV from varchar to integer, however, in the data type options provided by SSIS have at most Eight-byte, which is returning me the error

[Data Conversion [55]] Error: Data conversion failed while converting column "CONTA" (10) to column "Copy of CONTA" (72).
The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data."”.

Can someone help me or give me an alternative?

  • Already tried to import everything as varchar for a table (temporary) and then use this table to select/Insert in your target table?

1 answer

0


Right click on the task that fetches the CSV data and opens the Advanced Editor, then you go to the Input and Output Properties > Source > Output Columns > click on the field you want to change type > In the Datatype option you change from whatever is to NUMERIC[DT_NUMERIC]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.