CREATE TABLE CUSTOMERS_HIST(
ID INT NOT NULL,
NAME VARCHAR (50) NOT NULL
);
CREATE TRIGGER TRG_CUSTOMERS_DEL
ON Customer
FOR DELETE
AS
INSERT INTO CUSTOMERS_HIST (ID, NAME)
SELECT Id, Username
FROM DELETED
select * from Customer
delete from Customer where id=4
select * from CUSTOMERS_HIST
No comments:
Post a Comment