Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update statements and triggers
Message
 
 
À
20/06/2011 18:22:51
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Web
Divers
Thread ID:
01515217
Message ID:
01515219
Vues:
63
This message has been marked as a message which has helped to the initial question of the thread.
>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
>

Yes, second variation is indeed preferrable.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform