INSTEAD OF TRIGGER-WITHOUT ROLLBACK

Discussion in 'MCSD' started by Kaimuri, Jan 6, 2005.

  1. Kaimuri

    Kaimuri Guest

    I saw a comment in a book that in this INSTEAD OF Trigger, the fact that
    there is no rollback is an advantage. How is that?

    CREATE TRIGGER InsOrdDet ON [Order Details] INSTEAD OF INSERT AS DECLARE
    @qty int SELECT @qty=quantity FROM Inserted IF @qty<=(SELECT UnitsInStock

    FROM Products P JOIN Inserted I

    ON P.ProductID=I.ProductID)

    INSERT INTO [Order Details]

    SELECT * FROM Inserted

    ELSE

    RAISERROR('Not enough products in stock', 16, 1)
    Kaimuri, Jan 6, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?YW10?=

    ROLLBACK

    =?Utf-8?B?YW10?=, May 4, 2005, in forum: Microsoft Certification
    Replies:
    5
    Views:
    699
    Bob Christian
    May 8, 2005
  2. =?Utf-8?B?Sk5pZW1hbmQ=?=

    SUS enterprise rollback

    =?Utf-8?B?Sk5pZW1hbmQ=?=, Sep 8, 2005, in forum: MCSE
    Replies:
    40
    Views:
    1,301
    MitchS
    Sep 12, 2005
  3. Philip SC

    XP Rollback query

    Philip SC, Sep 24, 2003, in forum: Computer Support
    Replies:
    2
    Views:
    1,306
    Billh
    Sep 25, 2003
  4. Chef!

    Direct X rollback

    Chef!, Jul 23, 2003, in forum: Computer Information
    Replies:
    3
    Views:
    1,419
    Dave Bowman
    Jul 30, 2003
  5. CJ
    Replies:
    7
    Views:
    626
    David Matthew Wood
    Oct 28, 2006
Loading...

Share This Page