数据更新尤其是多表更新时,应注意哪些问题
你的意思是不是,增加明细表的时候,单号表的amount自动更新。
这样的话,写一个触发器就可以了。
123456789 create trigger 触发器名称on 明细for insertasbegin update 单号 set amount = a.amount + b.amount from 单号 a,inserted b where a.billid = b.billidend
热门标签:
你的意思是不是,增加明细表的时候,单号表的amount自动更新。
这样的话,写一个触发器就可以了。
123456789 create trigger 触发器名称on 明细for insertasbegin update 单号 set amount = a.amount + b.amount from 单号 a,inserted b where a.billid = b.billidend