IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_188_delete]') AND type = 'TR')
DROP TRIGGER [dbo].[order_188_delete]
GO
CREATE  trigger order_188_delete on order_188 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 

-- 以下是用户定义的语句 
 --=========================================================================================
 --中间表操作时，ord_sjczlx字段有内容,此时不做处理

 delete ebs2java.dbo.mps_depart_title
 from deleted d,ebs2java.dbo.mps_depart
 where dp_code = d.ord_dpbh
 and dp_id = dt_dpid
 and dp_isdepart = 1
 
 delete ebs2java.dbo.mps_depart
 from deleted d
 where dp_code = d.ord_dpbh
 and dp_isdepart = 1 
--=========================================================================================
-- 用户定义的语句完毕 

end