An SQL Server trigger fires once per a statement regardless of how many records are affected. It's obvious that
@iClaimPayersCount = @iMatchedPayersCount condition does not belong to UPDATE statement because it compares local variables only.
>I'm working on my first update trigger.
>
>An SP that operates on the column I'm monitoring for update includes this fragment
>
>
>UPDATE dbo.PATIENT_CLAIM_837_2000C
>SET Claim_Status = '00'
>WHERE Claim_Seq_No = @iClaimSeqNo
> AND @iClaimPayersCount = @iMatchedPayersCount
>
>
>
>Is there any reason THAT form is preferable to:
>
>IF @iClaimPayersCount = @iMatchedPayersCount
> UPDATE dbo.PATIENT_CLAIM_837_2000C
> SET Claim_Status = '00'
> WHERE Claim_Seq_No = @iClaimSeqNo
>
>
>
>The second form seems more efficient, and it does not fire the trigger if
>
@iClaimPayersCount <> @iMatchedPayersCount
>
>The first form fires the trigger even if there is no update.
>
>Thanks for any advice.
>
>Bruce
--sb--