• Sean, here is the "unsolved mystery". When I run your program pretty much as written, I get about 70,000 rows that don't update (null Return dates). Included in those rows is the following grouping.

    Yet when I tag this code right after where v.RowNum <= r.UnitCount, I get 623 records for VehiclesToUdate, ReturnsPros and VehicleDetail the way I should.

    How can this be?

    Select count(*) as UpdateCount, 'Update' as SQLName from VehiclesToUpdate Where Region='Central' And ProgYear='13' And LeaseCycle='1'And ModelName='FUSION I4 SE' And MFG='FRD' And RiskNonRiskFlag='R'

    GO

    Select Sum(UnitCount) as ReturnsCount, 'RCount' as SQLName from ReturnsPros Where Region='Central' And ProgYear='13' And LeaseCycle='1'And ModelName='FUSION I4 SE' And MFG='FRD' And RiskNonRiskFlag='R'

    GO

    Select count(*) as VDCount, 'Detail' as SQLName from VehicleDetail Where Region='Central' And ProgYear='13' And LeaseCycle='1'And ModelName='FUSION I4 SE' And MFG='FRD' And RiskNonRiskFlag='R'

    GO