Problem with Instead of Trigger

  • I have instead of delete trigger on my primary key table(master). when user delete record from master table, my instead of trigger first delete data from related foreign key table and at last delete the master table record. But I am getting problem now. When I delete a record from master table, it get delete. But after 1/2 min. that record comes into the table. (like rollback of command). Can anybody tell me why this is happing.

    thanks in advance

    Shrinivas L.K.


    Shrinivas L.K.

  • No!! But have you tried using a cascade delete and not a trigger to get the functionality you require? In table properties on the relationships tab check the 'Cascade Delete Related Records' check box.

    Regards,

    Andy Jones

    andyj93@hotmail.com

    .

  • I would look at Andy's solution.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • The first solution should work, the second is "better" depending on your overall requirements. I'd suggest profiling to confirm what is being actually executed. Is there a chance you have another process/trigger that is counter acting/restoring the change?

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

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

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