select * from tbl_TPM_Requests where assignedContractNbr = '00054000037223' and ownerId = 54 and ownerType = 'MFR' select * from tbl_TPM_Requests where assignedContractNbr = '00054000036225' and ownerId = 54 and ownerType = 'MFR' select c.claimId from tbl_TPM_Claims c inner join tbl_TPM_ClaimContracts cc on cc.ownerId = c.ownerId and cc.ownerType = c.ownerType and cc.claimId = c.claimId inner join tbl_TPM_Requests r on r.requestId = cc.requestId and r.ownerId = cc.ownerId and r.ownerType = cc.ownerType and r.requestId = where c.ownerId = 54 and c.ownerType = 'MFR' and c.deductionRef = and c.claimDate = and c.claimInvoice = and c.claimAmount = update cc set cc.requestId = from tbl_TPM_ClaimContracts cc where cc.ownerId = 54 and cc.ownerType = 'MFR' and cc.requestId = and cc.claimId = update tbl_TPM_Contracts set flaggedForRecalc = 'Y', flaggedForRecalcTime = getDate() where ownerId = 54 and ownerType = 'MFR' and contractId in ( , )

Rolling Back

Applied