I have merge statement like below, for eq. I have 1000 rows in t1 target , 900 rows in t2 the source and all of them in t1 target, I found DateModified has a new date for 900, so far is perfect.
But OUTPUT $action gives me 1000 for Update, why?, it should be 900 .
My script like this
Merge t1 t
* from t2
) As s
WHEN MATCHED THEN UPDATE
WHEN NOT MATCHED BY TARGET THEN
WHEN NOT MATCHED BY Source THEN UPDATE
OUTPUT $action into @Actions;