Home Forums SQL Server 2014 Development - SQL Server 2014 Transaction rollback when multiple threads are inserting records into table because of trigger RE: Transaction rollback when multiple threads are inserting records into table because of trigger

  • ravi.teja 62048 (6/18/2014)


    CREATE TRIGGER caseid_increment_trigger BEFORE INSERT ON ecase

    FOR EACH ROW SET NEW.case_id = (select ifnull(max(case_id),9999) + 1 from ecase where project_id = new.project_id);

    That's not a SQL Server trigger (SQL Server doesn't have FOR EACH ROW triggers, nor does it have BEFORE triggers). Maybe post your question on an MySQL site, rather than one dedicated to MS SQL Server?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass