0

My flat file connection manager has no file name selected because it's inside a foreach loop. With no file name selected, I can't add any new columns. These questions don't have the "no file name" issue, so they didn't work for me:

Add extra external column to flat file source

How to change flat file source using foreach loop container in an SSIS package?

How do I add a new column to my file format?

Here are my flat file connection manager and foreach loop:

Community
  • 1
  • 1
Doppelganger
  • 189
  • 4
  • 9
  • http://stackoverflow.com/questions/4281237/ssis-flat-files-with-variable-column-numbers – mr.Reband Feb 18 '14 at 18:22
  • That's not related at all. I read that question before I posted. It's about SSIS ignoring if you have more or fewer columns than it is expecting. Is that why I got the downvote? – Doppelganger Feb 18 '14 at 19:06
  • I did not downvote. The first answer in the link I posted explains how you can handle dynamic file structures. It is not easy, though. – mr.Reband Feb 18 '14 at 19:24
  • Why can you not select a file name, then setup the structure? – mr.Reband Feb 18 '14 at 19:32
  • I can, but I can't save unless I leave the bogus/hard-coded file name in there. – Doppelganger Feb 18 '14 at 20:11
  • If you're using a foreach loop container to cycle through filenames, then the bogus/hard-coded name won't matter. If it causes a run-time error because the file doesn't exist, then change the `DelayValidation` property in your `Abc` connection manager to `True`. – mr.Reband Feb 18 '14 at 20:20
  • You're exactly right. When I put anything in the "File name:" field, I can do what I need to. Once I save the _package_, the file name is automatically cleared out. Thank you for the help. Please add this as an answer so I can accept it. – Doppelganger Feb 18 '14 at 20:32

1 Answers1

1

Just select a file name in your Abc flat file connection manager, then setup the structure.

If you're using a foreach loop container to cycle through filenames, then the file you choose won't matter -- it's used for design only.

If you get a run-time error because the file doesn't exist, then change the DelayValidation property in your Abc connection manager to True.

mr.Reband
  • 2,434
  • 2
  • 17
  • 22