• rodgersem (8/9/2013)


    Hello -

    I'm new to SQL Server and this forum. I'm trying to convert a simple Oracle trigger to SQL Server 2008. I know the BEFORE needs to be converted to INSTEAD OF but have no idea of the nomenclature. Thanks in advance, any assistance is appreciated.

    CREATE OR REPLACE TRIGGER SET_COMBINELIKECATEGORIES

    BEFORE INSERT ON CATEGORY

    FOR EACH ROW

    BEGIN

    :new.combinelikecategories := 0;

    END;

    Wouldn't it be a heck of a lot easier to just put a DEFAULT of "0" o the CombineLikeCategories column of the Category table instead of using a trigger?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)