Trigger to back up the deleted data in another table

Posted by Ddd under Sql Server category on | Points: 40 | Views : 4016
/*emp has 3 columns

create another table emp1*/
select * into emp1 from emp where 1=2

create trigger trg on emp for delete
insert emp1 select * from deleted

--Test the Trigger
delete from emp where eno=445(say)

The row wil be copied into emp1 through the deleted table

Comments or Responses

Login to post response