I have 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
Table in the SQL Server database is as following/
CREATE TABLE csvtable
( sno int
, sname varchar(100)
, quantity numeric(5,2)
)
I created an SSIS package to import csv file data into the database table. I am getting an error during package execution because the quantity is a string. I created another table to store the invalid data.
CREATE TABLE wrongcsvtable
( sno nvarchar(10)
, sname nvarchar(100)
, quantity nvarchar(100)
)
In the csvtable, I would like to store the following data.
sno sanme quantity
--- ------ --------
1 aaa 23
3 ccc 34
6 fff 87
In the wrongcsvtable, I would like to store the following data.
sno sanme quantity
--- ------ --------
2 bbb null
4 ddd ddd
5 eee xxx
Could someone point me in the right direction to achieve the above mentioned output?