开发者

Create a before delete trigger?

   id    country_name   region     area         population

    1   LASvega      Americas      2314       2134562    
    2   California   AMERICAS      10101      2134562   
    3   Algeria      Middle East   24000000   32900000  
    4   Andorra      Europe        468        64000         

fire开发者_JAVA百科 a delete query , just before that this trigger is fired and saved that said record into another table.. if i want to delete record no 3 then saved it into another table.


You can use the special Deleted table that is available within an UPDATE or DELETE trigger.

CREATE TRIGGER trg
ON tbl
FOR DELETE

INSERT INTO OtherTable
   SELECT * FROM Deleted
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜