简体   繁体   中英

Microsoft SSIS Conditional Split is not working correctly

I need to do the conditional split of data based on the source file record count and process data count if both count match then only i need to perform the insert into DB table but some where my conditional split is failing please find the screen shot and let me know what is wrong

在此处输入图片说明 在此处输入图片说明

Put an expression on the precedence constraint between conditional split and OutputRowCount and put the same expression in there. Simple fix.

I don't think that you can achieve that within one data flow task , since variables values are committed at the end of Data flow Task execution.

In your case it will always shows that the row counts are equals since they are both equals to zero.

You have to create 2 data flow task and one script task:

  1. First Data Flow Task to get the Original Count and Extracted count and to store them within two variables.
  2. Second Data Flow Task is to import Data into an OLE DB Destination (just a Flat File Source and an OLE DB Destination)
  3. The Script Task is to notify user that the data is Invalid

Add a precedence constraint between the First DFT and the second one. In addition, add a precedence constraint between the first DFT and the Script Task

On each precedence constraint add an expression:

Between Data Flow Tasks

@[User:OriginalRowCount] == @[User::ExtractedRowCount]

Between DFT and Script Task

@[User:OriginalRowCount] != @[User::ExtractedRowCount]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM