注册 登录
编程论坛 SQL Server论坛

SQL触发语句出错

vivazheng 发布于 2019-09-07 08:29, 1529 次点击
Create trigger vivapur   
on                        
PU_AppVouchs              
for                       
update                    
as                        
begin   
               
update PU_AppVouchs set cDefine23=(select cInvCode,cWhCode, SUM (ItemId) as 汇总
 from CurrentStock
 where cWhCode='30'   
GROUP BY cInvCode,ItemId,cWhCode)        

from                                                      
CurrentStock,PU_AppVouchs,PU_AppVouch
           
where                                                      
PU_AppVouchs.cInvCode=CurrentStock.cInvCode               
and
PU_AppVouchs.id=PU_AppVouch.id
and
CurrentStock.cWhCode='30'
end
问下这个触发语句应该怎么写才对。

[此贴子已经被作者于2019-9-10 09:02编辑过]

0 回复
1