I'd like to thank everyone for their input.Here's what I've done and learned...I used GP Power Tools (Thanks @David Musgrave) to Script out the SQL that was running. The stored proc rmCustomerCombiner is called for each customer being modified. That ends up calling the stored proc rmCustomerCombinerMaster. rmCustomerCombinerMaster has what I would consider a bug. It has the following logicCREATE CURSOR ta_CCCursor with some SQL code to excute (updates or deletes)Open the cursorWhile the cursor is happy, loop Execute some SQL returned by the cursor if There as an error Set an error state and RETURN from the stored procEnd WhileDEALLOCATE CURSORThis pattern is in the rmCustomerCombinerMaster 11 times. One of my pet peeves in programs is routines that have multiple returns. Why? Because it is easy to forget what needs to be cleaned up when returning early. In this case, the RETURN happened before the DEALLOCATE CURSOR is called. So, when there is a problem on the 10th customer, the 11th also fails because the cursor was not DEALLOCATE properly on the 10th record.So, I restored my test company (again...), updated the rmCustomerCombinerMaster stored proc deallocating the cursor before each return. Then, I used replicator to create the SQL code to call rmCustomerCombinerMaster for each of my 47 records:DECLARE rmCustomerCombiner CHAR(27)DECLARE @retstat INTDECLARE @param3 INTDECLARE @Customer CHAR(31)SET NOCOUNT ONSET @Customer = 'C05650'EXEC @retstat = rmCustomerCombiner @Customer, 'C21290', @param3 OUTPUTSELECT @retstat, @param3, @Customer AS '********'SET @Customer = 'C14476'EXEC @retstat = rmCustomerCombiner @Customer, 'C65323', @param3 OUTPUTSELECT @retstat, @param3, @Customer AS '********'(Rinse and repeat)After running the script in SSMS with text output, I saw what I and everyone else expected... an ISV problem.Violation of PRIMARY KEY constraint 'PKW5026CustItemRevs'. Cannot insert duplicate key in object 'dbo.W5026CustItemRevs'. The duplicate key value is (C50733 , E3-2000-750-NE-H-D-B , 1.00000).Sorry for my rambling, but I thought you might want to see the results. It turns out the customer I thought had the problem didn't, the previous one did.
If you've found this thread useful, dive deeper into User Group community content by role