sql触发器进行插入,执行更新 [英] sql trigger for insert, do update
本文介绍了sql触发器进行插入,执行更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好.
我需要触发器的帮助
我需要在表A中插入数据时将更新表B的触发器.
exp.
在表AI中输入PrID和数量,我需要的是转移表B中的数据,当PrID相同时,我需要具有数学TableB.Qauntity = TableB.quantity + Inserted.quantity,其中tableB.prID = insert.prID.
THNANSK
Hi all.
I need help with triggers
I need triger that will update Table B when I insert Data in Table A.
exp.
in table A I input PrID and quantity, whe i need is to transfer that data in the table B and when PrID is same I need to have math TableB.Qauntity = TableB.quantity+Inserted.quantity where tableB.prID = inserted.prID.
THNANSK
推荐答案
您是否进行了任何研究?这很容易做到,触发器将传递刚刚插入的信息,并且您可以编写SQL将其存储在任何您喜欢的位置.
Have you done any research at all ? This is easy to do, the trigger gets passed the information that was just inserted, and you can write SQL to store it where-ever you like.
是的,我已经重新设计但缺少一些东西,我是菜鸟新手
yes i have reserch but somethink is missing , i am novice user, rookie
这篇关于sql触发器进行插入,执行更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文