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
精彩评论