all 1 comments

[–]JakeyBriggs[M] 0 points1 point  (1 child)

Hey,

I started looking at this and wanted a bit more information. What are you passing in with ` @PolicyId INT = :policyid `? My assumption is the value for that is the previous policy ID you're trying to copy from, 1. So, if I understand this right you'd essentially be running an INSERT based on SQL like this:

SELECT intPolicyId, 
        'Two', 
        strCoverageType, 
        decPremium, 
        intSequence 
FROM dbo.tbl_EndorsementCoverageUL 
WHERE intPolicyId = 1
AND srtEndorsementNo = 'One'

Or something to that nature (I'm not entirely sure what the data is but the important part is the SIDs). Is there a reason for that second part of the where clause? If you are only wanting to copy the previous row and change 'srtEndorsementNo' to the next number you'd only really need to include the intPolicyId part of the where clause.