I am working on a SSIS Task of loading data from the staging database to Live data base for a product workorder database.
I need to split the loading into New and Updated Values and based on the split, i will insert or update the records in the Live database.
I have created conditional split for New rows. However on creating condition for updated rows, my package is getting failed based on the reason
[Conditional Split [2]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Conditional Split" failed because error code 0xC020902B occurred, and the error row disposition on "Conditional Split.Outputs[Updated Rows]" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
I found out the error occurred because of the condition i have specified. I have too many AND and OR conditions in my conditional split.
In my requirement, i will have Workorder ID and ProductID as consistent, however there will be rows like Order Quantity, Stocked Qty, Scrapped Qty getting updated in each data load. So I created the condition in conditional split as below
(srcWorkOrderID == lkpWorkOrderID) && (srcProductID == lkpProductID) && (srcOrderQty != lkpOrderQty) || (srcStockedQty != lkpStockedQty) || (srcScrappedQty != lkpScrappedQty)
..... and so on.
So if my workorderid and product id is matching in my staging and live database and other columns are not matching, i need to update all the other non matching columns in the Live Database.
If I specify only one not equal to condition like (srcWorkOrderID == lkpWorkOrderID) && (srcProductID == lkpProductID) && (srcOrderQty != lkpOrderQty)
my package executes perfectly.
However I need multiple not equal to comparisons in my condition.
Any workaround for this?????
MERGE
statement – Nick.McDermaidsrcOrderQty+srcStockedQty+srcScrappedQty
and compre withlkpOrderQty+lkpStockedQty+lkpScrappedQty
. Of course you must convert them to strings before concentanating. You will get one long string and compare with other :) – Justin