Created
June 5, 2021 13:33
-
-
Save radityopw/cbe76f6b0454c5cbbbfca794b8cd5287 to your computer and use it in GitHub Desktop.
readonly table trigger
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 <schema>.<table_name>_read_only_events ON <schema>.<table_name> | |
INSTEAD OF INSERT, | |
UPDATE, | |
DELETE | |
AS | |
BEGIN | |
RAISERROR( 'table is read only.', 16, 1 ) | |
ROLLBACK TRANSACTION | |
END |
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
DROP TRIGGER <schema>.<table_name>_read_only_events; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment