开发者

How to create conditional destinations in SSIS Data Flow?

开发者 https://www.devze.com 2023-01-17 22:35 出处:网络
Goal: I have a Db source. Depending on a variable, i need to s开发者_StackOverflowtore it into a fixed width file OR a delimited file.

Goal: I have a Db source. Depending on a variable, i need to s开发者_StackOverflowtore it into a fixed width file OR a delimited file.

How do I do this in a data flow? I tried creating a conditional split, with two conditions. One condition going to a fixed width destination, and one to a delimited condition. Problem is that conditional split executed BOTH conditions even if no data comes in one condition. Becuase filename is same, so it errors out.


I would keep your solution with the folowing tweeks.

Write out to two Filename-fixed.txt and filename-delim.txt. Before those steps add row count tasks.

How to create conditional destinations in SSIS Data Flow?

Then in your control flow you have two Success paths. Edit the success paths to look for both success and expression. Add an expression that checks the count from the new row count tasks in your dataflow. If you have file system tasks as your end point have them rename your fixed or delim file to the correct file name.

How to create conditional destinations in SSIS Data Flow?

How to create conditional destinations in SSIS Data Flow?

Note: I didn't try this and the pics all have red x's because I find it helpful to have the picture to figure out the logic not because I actually coded the solution.


Use two different data flows and do the diversion from with in the control flow. If you want to do it within the data-flow itself I guess you will have to use different filenames.

0

精彩评论

暂无评论...
验证码 换一张
取 消