on 2011 Dec 16 10:30 AM
If one has multiple actions for the same event (e.g. after insert), what is the best practise
Any advantage of the first or second approach over the other?
In the main I don't think it matters all that much, but here are some issues to consider:
ORDER
clause so that you can precisely specify the trigger firing order; these considerations also apply to Sybase ASE. In the SQL standard, trigger firing order is based on trigger CREATION time and several systems follow that convention. INSERTING
, UPDATING
, and DELETING
so that you can determine within the trigger what base operation invoked it.You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would add that
if compatibility with other DBMS is at all a concern
you usually will not be able to use the rich set of trigger features in SQL Anywhere - possibly no BEFORE triggers, no ROW LEVEL triggers (with their much easier semantics IMHO) - at least I always feel "in limited mode" when I have to deal with MS SQL triggers...
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.