How to reverse engineer a Flat File Connection?
I am trying to fix a fairly complicated ETL package that was created by a consultant, and I'm afraid of breaking it badly. The package has a Flat File Connection Manager (for a CSV file source) that obtains the file name assigment via a variable set in a Foreach Loop Container. I have discovered that the source files actually contain several more columns than are visible in the Flat File Source component, and the data in these are being concatenated (commas and all) into the last column shown in the Flat File Source editor. It seems that I cannot make these columns visible by editing the Flat File Source component. Also, I can't see how to specify the extra columns in the Flat File Connection Manager because it cannot be edited as long as it has nothing in the File Name edit box (i.e. because of the variable file name). I'm guessing that I will need to (temporarily) change the Flat File Connection Manager to point to an actual instance of the CSV source files before I can remap the columns in the Flat File Source, then empty the File Name box again. Does this sound like the correct approach? Will I lose anything (variable mappings, whatever) that I will need to reinstate? Thanks! - Al
February 22nd, 2011 4:26pm

Apparently there are some new/extra columns that where not there when your consultant first made that Flat File Connection Manager. Can't you make a new Flat File Connection Manager that is correct for your currect CSV file. After that you can change the connection manager in the Flat File Source Component. If you keep the column names the same it won't be that hard to change the connection manager.Please mark the post as answered if it answers your question | My SSIS Blog: http://microsoft-ssis.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2011 4:43pm

It seems that I cannot make these columns visible by editing the Flat File Source component. Also, I can't see how to specify the extra columns in the Flat File Connection Manager because it cannot be edited as long as it has nothing in the File Name edit box (i.e. because of the variable file name). Hi Al, This is not the case. You *can* make these columns visible (aka add new columns) and this is done by eiting the Flat File Connection Manager. Simply enter some ficitious file name - doing so will enable you to switch to the Advanced tab where you can manually define your new columns. Once you have clicked "OK" you can simply go to the properties pane and change the ConnectionString (i.e. the file name) back to whatever it was before. I'm pretty sure this will work for you. Once the columns are defined in the Connection Manager the Flat File Source Component will be able to do something with them. Regards Jamiehttp://sqlblog.com/blogs/jamie_thomson/ | @jamiet | About me
February 22nd, 2011 6:19pm

Thanks, SSISJoost. There have been no changes to the extract that provides the source data, so the columns aren't new. Dunno how they were missed in original design (but they did have null data for the 1st few 100 rows).
Free Windows Admin Tool Kit Click here and download it now
February 22nd, 2011 9:05pm

Thanks, Jamie. That's basically what I proposed in the last paragraph of my question. I just tried it, and it seems to work. (Now I have a cranky Union All component downstream, but I'll plug away at that.)
February 22nd, 2011 9:06pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics