scd:
dh,date,kh,zk,xx,pm,le,wi,he,gg,sl,zdw,zdl,wsl,lsl,ll,wl,ys,am,bm,cm,dm,em,isyc,memo,jine,date1,idshd:
dh,no,date,kh,addr,shr,ch,gxr,shr1,memo,ji,pm,lb,gg,sl,dj,cldj,je,isyc,memo,len,wid,hei,id ys_hl:
dh ,date,ke, zje,date2,date3
我要在scd 输入时,将一部分数据过滤到shd 中,但是shd 还要可以修改。
然后将shd 数据过滤到 ys_hl 中。
具体我想用触发器,
请问大虾们,怎样才能作好他呢?
dh,date,kh,zk,xx,pm,le,wi,he,gg,sl,zdw,zdl,wsl,lsl,ll,wl,ys,am,bm,cm,dm,em,isyc,memo,jine,date1,idshd:
dh,no,date,kh,addr,shr,ch,gxr,shr1,memo,ji,pm,lb,gg,sl,dj,cldj,je,isyc,memo,len,wid,hei,id ys_hl:
dh ,date,ke, zje,date2,date3
我要在scd 输入时,将一部分数据过滤到shd 中,但是shd 还要可以修改。
然后将shd 数据过滤到 ys_hl 中。
具体我想用触发器,
请问大虾们,怎样才能作好他呢?
CREATE TRIGGER [triggername] ON scd
FOR INSERT
AS
begin
insert into dhd(字段....) select 字段.... from inserted where 过滤条件
update shd set 字段=。
insert into ys_hl(字段...) select 字段... from dhd where 过滤条件
end
你写入数据时也可以实现的啊!table1.输入('hh.text','date.text'...)
table2.输入('hh.text','no.text',....)
即: scd 插入后 触发shd, 在触发生成ys_hl!!