I receive a CSV file from an outside source. I need to import it into a table where all the columns are varchar with varying widths depending on the data (i.e Email is 255, FirstName is 100, etc).
The standard SSIS Flat File Source in the Data Flow task sets all the columns to String(50). This is too long for some columns in the target table, resulting in erroneous truncation warnings, and too short for many other columns, resulting in truncated data and failures in the step.
I can go into the column definitions and manually set them all to match the target table schema, but that seems counter-productive and counter-intuitive for a product that is designed specifically to do this kind of work. Plus there are 83 columns in this table and that's a lot of drudge work for something I should be able to automate.
Has anyone run into this and found a way to solve it using automation? I suspect I could write a script task to iterate through the target schema and set the source column widths but I'm a newbie to SSIS and not sure where to start with that.
Any help would be greatly appreciated.
Start Free Trial