I have a CSV file with three columns.
sno sname quantity --- ----- -------- 1 aaa 23 2 bbb null 3 ccc 34 4 ddd ddd 5 eee xxx 6 fff 87
The table in the SQL Server database is as follows:
CREATE TABLE csvtable ( sno int , sname varchar(100) , quantity numeric(5,2) )
I created an SSIS package to import CSV file data into a database table. I get an error at runtime because the quantity is a string. I created another table to store invalid data.
CREATE TABLE wrongcsvtable ( sno nvarchar(10) , sname nvarchar(100) , quantity nvarchar(100) )
In csvtable, I would like to save the following data.
sno sanme quantity --- ------ -------- 1 aaa 23 3 ccc 34 6 fff 87
In the wrong table, I would like to save the following data.
sno sanme quantity --- ------ -------- 2 bbb null 4 ddd ddd 5 eee xxx
Can someone point me in the right direction to achieve the above exit?
source share