• Hugo Kornelis (4/23/2013)


    The first sentence of the explanation should probably have read "Instead of triggers can cascade regardless of the setting of the nested trigger server option."

    yes, you are write. Silly of me.

    Hugo Kornelis (4/23/2013)


    The code in this question contains:

    * A somewhat complex view definition that is not immediately obvious;

    * Two instead of triggers that both are, while not really complex, not immediately obvious;

    * A very complicated piece of code to populate the table (really, just putting in a VALUES clause with the five rows would have been so much easier).

    *this* amount of code-. It's always easier to kill someone else's darlings).

    There certainly was some unneccessary complexity. But that was intentional. You may recall that a few weeks back I responded to something (I can't remember what) in the forums with the comment that it was tempting me to produce a nasty complex question using instead of triggers. I resisted the temptation for a few days, but then succumbed and this was part of the result. Actually I reduced the complexity a lot from the first version, but it's still rather complex for a QotD.

    I don't think the method of populating the table is unreasonable though - but maybe it is with only 5 rows (the original had varchar(27) instead of varchar(6) and 27 rows - using @ to Z instead of 5 using A to E).

    Tom