求帮助。
CREATE TRIGGER TR_CLBM_CR
ON CL_BM
FOR INSERTED
AS
IF (select count(*) from deleted)=0 and (select count(*) from inserted) >0
begin
INSERT ZD_YZ(LX, BM, DH, MC, DJ, JL, YLDW, JLDW, GG, FYLB, CLLB, STATE, ZXBZ, GBBM, PRINTMC)
SELECT top 1
1, BM, DH, MC, DJ, 1, DW, DW, GG, FYLB = 71, CLLB=0, STATE = 0, ZXBZ = 0 , GBBM, PRINTMC=mc
FROM CL_BM where lb like '2%' and bm not in (select bm from inserted)
end
触发器功能要求:
当CL_BM中插入一条记录,同时在ZD_YZ表中写一条记录,上面是我写的触发器,但触发器没有生效。