有两张表A和B,要求往A里面插入一条记录的同时要向B里面也插入一条记录,向B里面插入一条记录的同时也向A插入一条记录.两张表的结构不同,需要将其中几个字段对应起来.可以用下面的触发器实现. 表A的触发器: begin set @disable=1; if @disable=1 and NOT EXISTS(SELECT 1 FROM tableB where ID=new.ID) then insert into tableB (ID,对应字段1) values(new.ID,new.对应字段1…
在日常工作中,在SqlServer2008R2中,需要向一张表上加上触发器,监控插入.更新.删除. --一个触发器内三种INSERT,UPDATE,DELETE状态 IF exists(select 1 from inserted) and not exists(select 1 from deleted) begin --INSERT end IF exists(select 1 from inserted) and exists(select 1 from deleted) begin --…
================START============================== 来了一个mail说是job跑得很慢,调查下原因 先来看下sql: SELECT h.order_no AS SO_no, h.order_type, h1.order_no AS po_no, l1.order_line_key AS PO_LKEY, l1.shipn…
4张表:filter nat mangle raw filter:协议过滤: nat:地址转换,端口映射等: mangle:协议修改 TTL等: raw:This table is used mainly for configuring exemptions from connection tracking in combination with the NOTRACK target. It registers at the netfilter hooks with hig…