Create SSIS package to import from one of many data sources

前端 未结 2 661
面向向阳花
面向向阳花 2021-01-24 07:56

Is it possible to create an SSIS package that can be passed a file (through a variable) and from the variable determine which Data Flow Task to use?

What I would like to

2条回答
  •  深忆病人
    2021-01-24 08:32

    As HLGEM has indicated, as long as the internal structure was consistent, something like this would suffice.

    I'd declared a package level variable, DatFlowSelector and within my initial script task, I'd use logic to determine what path the flow should take based on the FileName variable you were going to use.

    control flow

    After wiring up the expected outputs, use the Precedence Constraint editor to determine what path evaluates to true. My logic was simply @[User::DataFlowSelector] == N where N maps to the value my script assigned.

    I generally switch the ShowAnnotation property to "ConstraintOptions" when I modify the constraints as it makes it immediately clear to future maintainers that there is something going on. SQL 2012 will help in this case as it assigns the fx glyph to the connector but displaying the logic can provide at-a-glance confirmation of sound logic.

    precedent constraint editor

提交回复
热议问题