• I MAY have success finally!

    If I run the same query below against VehiclesToUpdate I get 9. So the update can choose "X" number of VINs not caring if the VINs are unique. They MUST be unique. That is why it's ignoring so many rows to update.

    Select COUNT(*)

    From VehicleDetail

    Where Vin='DN656102'

    Correct me if I am wrong, but if I turn the VehiclesToUpdate section into a subquery to keep the VINs unique, this may solve the problem. I think it is worth a shot. I haven't tried this, but I bet if ran a select distinct VIN on VehiclesToUpdate after the Where v.RowNum <= r.UnitCount line, I would not get the correct number of records for whatever group I am focusing on.

    I'll keep you posted even though you probably won't read this until Monday.