SHARE
TWEET

Untitled

a guest Dec 6th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. GO
  2. CREATE TRIGGER update_amount_sell ON tblHas after INSERT AS
  3. BEGIN
  4.     UPDATE tblSell
  5.     SET tblSell.amount = tblSell.amount - (
  6.         SELECT amount
  7.         FROM inserted
  8.         WHERE idShop = tblSell.idShop AND idProduct = tblSell.idProduct
  9.     )
  10.     FROM tblSell
  11.     JOIN inserted ON tblSell.idProduct = inserted.idProduct AND tblSell.idShop = inserted.idShop
  12. END
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top