Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MERGE Syntax
Message
De
18/01/2017 19:29:14
 
 
À
18/01/2017 12:46:35
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Versions des environnements
SQL Server:
SQL Server 2012
Divers
Thread ID:
01646827
Message ID:
01646837
Vues:
48
If I can make a suggestion - you might want to considering adding this, in addition to the JOIN between Inserted and Deleted
WHERE D.iQty <> i.IQty
(and you might even need to account for NULL values as well)

Reason for this - if the trigger fires even though a quantity wasn't changed (i.e. old value and new value are the same), the MERGE doesn't need to occur.

Also -just curious, why use a MERGE when you're only performing an UPDATE?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform