What would Cause an INSTEAD OF DELETE Trigger to not stop a DELETE

  • You folks aren't gona believe this, I can't believe it myself, but I've tried it 3 times now and sure enough my INSETAD OF DELETE trigger is not preveneting a Deletion on the table it is defined on. I even used Profiler to trace the activity and I can see the DELETE execute as well as the INSTEAD OF DELETE trigger fire. Theres no errors or warnings. Both the DELETE and the TRIGGER execute.

    What am I missing?

    How is this possible? I am not that familair with INSETAD OF Triggers so maybe I would have trouble getting a complex one to not work right but a simple plain old INSTEAD OF DELETE Trigger with no udpates or other DML defined in the trigger should work fairly straight forward shoudn't it?

    What could I be missing?

    Kindest Regards,

    Just say No to Facebook!
  • Hard to say. Can you recreate the problem in a test environment that you could share the code with us? I'd rather not have you post the real table(s), code, and sample data.

  • Lynn Pettis (4/15/2010)


    Hard to say. Can you recreate the problem in a test environment that you could share the code with us? I'd rather not have you post the real table(s), code, and sample data.

    Thanks for replying so quick LYnn but I figured this one out.

    I had 2 connections open each was connected to a different Tes/Dev copy of my DB. NOrmally I have just 1 copy on the Dev server but we have second running right now and because the name diff is 2 numbers at the end I couldn't see the Forest for the Trees.

    Clearly its time to call it a day and go home to rest.

    Thanks

    Kindest Regards,

    Just say No to Facebook!
  • When aside from a code 18 :

    - The trigger can be disabled

    - The trigger may be set on the wrong table (dbo.table1 & user2.table1)

    - I think I remember bulk insert or bcp bypassing (or being able to) the triggers but I'm too lazy to recheck.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply