0

I have a number of flat files which have one of two formats (soon to be four) and the columns differ slightly.

I have set up 2 different connection managers for the different formats, but I would like to choose the appropriate connection manager for the flat file source at run time.

So far I have a script task which returns the columns and sets a variable depending on which file type it is. I want to use this variable to set the flat file connection manager at run time.

Is this possible? If so how?

ryanyuyu
  • 6,366
  • 10
  • 48
  • 53
CatchingMonkey
  • 1,391
  • 2
  • 14
  • 36
  • I don't think you're going to be able to do what you want to, at least with SSIS. I make that statement based on `columns differ slightly`. SSIS is rather persnickety about the metadata within a data flow. Make a column take more room than it was defined and SSIS defecates the bed. How do they differ? If it's the same columns in different order or an extra column in one of the file that isn't required, then I have some bloody hacks for you. Otherwise, I think you're looking a 2 data flows with expressions controlling the filename used for the connection manager – billinkc Nov 08 '13 at 16:37
  • One file has a column that the other doesn't, i think i have a hack for it, which i'm working on now, but i'm all ears if there's something more elegant. At the moment i have two data flows and a "Precedence Constraint" switching between the two. – CatchingMonkey Nov 08 '13 at 17:10
  • This answer is the one I was thinking of to handle a column not in existence and you also don't care about it. http://stackoverflow.com/questions/8168548/ssis-task-for-inconsistent-column-count-import/8173162#8173162 – billinkc Nov 08 '13 at 18:49

0 Answers0