IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[mps_task_kernel_delete]') AND type = 'TR')
DROP TRIGGER [dbo].[mps_task_kernel_delete]
GO
CREATE trigger [dbo].[mps_task_kernel_delete] on [dbo].[mps_task_kernel] for delete as
begin
    
    
insert into mps_task_kernel_bak(
tsk_id,
tsk_date,
tsk_command,
tsk_times,
tsk_type,
tsk_bizid,
tsk_wrkid,
tsk_wsid,
tsk_jbid,
tsk_ordid,
tsk_from,
tsk_reason,tsk_usedtime)
select tsk_id,
tsk_date,
tsk_command,
tsk_times,
tsk_type,
tsk_bizid,
tsk_wrkid,
tsk_wsid,
tsk_jbid,
tsk_ordid,
tsk_from,
tsk_reason,tsk_usedtime
from deleted 

end