I have this SSIS task, I read the contents of a CSV file and then I insert into a table
In one of the columns I should perform a trim in the values before inserting them in the table, how can I modify the csv before the insert?
CodePudding user response:
Add a Derived Column transformation in the data flow between the Flat File Source and the ADO/ODBC/OLE Destination there.
If you want to trim, then you need to apply both a left and a right trim operation. I favor creating new columns versus renaming existing as I find it's easier to debug.
Assuming I have an inbound column named Col1
, I would define a new column called Col1_Trimmed
And remember that SSIS column names are case sensitive
LTRIM(RTRIM([Col1]]
Caveats about what is whitespace in the documentation for LTRIM