SQl Server 2008 两张表同时变化 触发器
详细问题看图片,以下是已经写出的语句,求完善ALTERtrigger[dbo].[pubkszl_311001]on[dbo].[PUBKSZL]afterinsert,...
详细问题看图片,以下是已经写出的语句,求完善ALTER trigger [dbo].[pubkszl_311001]on [dbo].[PUBKSZL]after insert,deleteasbegininsert into GL_Fzxzl(gsdm,kjnd,lbdm,fzdm,fzmc,zjm,sfmx)select pubkszl.gsdm,pubkszl.kjnd,lbdm='9',fzdm=pubkszl.dwdm,fzmc=pubkszl.dwmc,zjm=pubkszl.jym,pubkszl.sfmx from inserted,pubkszl where pubkszl.gsdm='311001' and pubkszl.kjnd='2018' and pubkszl.dwdm like 'C%' and pubkszl.dwdm=inserted.dwdmendbegindelete from GL_Fzxzl where gl_fzxzl.fzdm in (select fzdm=deleted.dwdm from deleted where deleted.dwdm like 'C%' and deleted.gsdm='311001' and deleted.kjnd='2018' ) and gsdm='311001' and kjnd='2018' and fzdm like 'C%'end
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询