Hi
I think If a trigger run On Insert, and the insert statement was in transaction, an error in the trigger will return to the transaction and I can catch it and ROLLBACK.
Is that correct? Is there problems or concerns about that?
Thanks
Hi
I think If a trigger run On Insert, and the insert statement was in transaction, an error in the trigger will return to the transaction and I can catch it and ROLLBACK.
Is that correct? Is there problems or concerns about that?
Thanks
That is a perfectly valid use of triggers, nothing wrong with it.
Trigger based constraints rely on this method.
This is true unless you actually call RAISEERROR
yourself in the trigger. In that case you must actually call ROLLBACK TRANSACTION
as well.