ppupil2

Q9-PE-Demo

Jul 24th, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.43 KB | None | 0 0
  1. CREATE TRIGGER [InsertProduct] ON [Product]
  2. AFTER INSERT --thực hiện trigger sau khi: INSERT, DELETE, UPDATE
  3. AS
  4. BEGIN --thân TRIGGER trong BEGIN END;
  5.     SELECT
  6.         INSERTED.[ProductName],
  7.         [SubCategory].[SubCategoryName]
  8.     FROM
  9.         INSERTED
  10.         INNER JOIN [SubCategory]
  11.         ON INSERTED.[SubCategoryID] = [SubCategory].[ID]
  12. END;
  13.  
  14. /*
  15. insert into Product(ProductName, UnitPrice, SubCategoryID)
  16. values ('Craft paper', 0.5, 3)
  17. */
  18.  
Add Comment
Please, Sign In to add comment