Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
INSTEAD OF Triggers
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01467449
Message ID:
01467450
Views:
84
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?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform