Last active
November 13, 2020 14:46
-
-
Save alfonsusac/5b9c89caaf7892d7f09b4c25b5010c59 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TRIGGER Trigger_name -> declraing a trigger with Trigger_name | |
(AFTER) -> when the trigger will be executed | |
[ INSERT | UPDATE | DELETE ] -> The operation that can be performed | |
ON [Table_Name] -> which table to do the operation on | |
AS | |
[ Trigger_body ] -> the queries to be executed by trigger | |
CREATE TRIGGER trigger_name ON ms_customers | |
AFTER INSERT,UPDATE,DELETE | |
AS BEGIN | |
SELECT * FROM DELETED | |
SELECT * FROM INSERTED | |
END | |
Creates two temporary table called INSERTED and DELETED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment