Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INSTEAD OF Triggers
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01467449
Message ID:
01467450
Vues:
83
This message has been marked as the solution to the initial question of the thread.
I am curious about how the INSTEAD OF clause works in the TRIGGER statement.

If I had a table in which I were trying to prevent duplicates on a name field, and were using an INSTEAD OF clause in it for INSERT, UPDATE, and I was then doing for example, an INSERT statement to set off the trigger, does this mean that the INSERT statement would never actually be used at all, and that everything I'd need to do would have to be contained within the Trigger itself?


Cecil, in general, that's correct. One might debate that there are other means to do this, but yes, that works.

Another example of an INSTEAD OF trigger...suppose that when someone wants to DELETE, you actually want to simply mark the row with a "DeleteFlag". So "instead of" the delete, you update the row and set the DeleteFlag to true.


Different subject....that trigger code from the other night...did that wind up working?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform