IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_40_delete]') AND type = 'TR')
DROP TRIGGER [dbo].[order_40_delete]
GO
CREATE  trigger order_40_delete on order_40 for delete as
begin
   insert into mps_sync(sk_type,sk_bizid,sk_tag2,sk_operation,sk_objid) 
   select 1,ord_bizid,0,-1,ord_id from deleted 

-- 以下是用户定义的语句 
/*======================================================================*/ 

/*删除时，删除员工信息、登录信息、角色信息*/
delete ebs2java.dbo.mps_login_role 
from deleted,ebs2java.dbo.mps_employee 
where ord_gh = cu_account
and cu_id = lgu_cuid
/*and ord_rztx ='营运'*/

delete ebs2java.dbo.mps_login from deleted where ord_gh = cu_account 
/*and ord_rztx ='营运'*/

delete ebs2java.dbo.mps_employee from deleted where ord_gh = cu_account 
/*and ord_rztx ='营运'*/

/*======================================================================*/ 
-- 用户定义的语句完毕 

end