Hi Please help me on this..... 1. I need to do "before delete" trigger implementation. But which is not supported by MSSQL server. Please help me how to achieve this.... Thanks n Regds.
Hi, I do not understand what do u mean by BEFORE DELETE trigger. The FOR DELETE trigger in SQL Server is the before delete trigger itself. Refer BOL for the same. Rgds, Chetan
I can create INSTEAD OF TRIGGER, because after performing certain activities at the time of this trigger, records will not be deleted as like in "BEFORE DELETE".
If you have an INSTEAD OF trigger, and you still need to get the action done on the underlying table, then you have to repeat the action in the trigger. Add a statement like this to your INSTEAD OF DELETE trigger, which joins the underlying table to the "deleted" conceptual table: DELETE FROM MyTable WHERE <key> IN (SELECT <key> FROM deleted) Note that you cannot have an INSTEAD OF trigger if the table is also the parent table in a foreign key relationship with cascading deletions.