Create a trigger to restrict access on a specific day

how to create a trigger to restrict access of the insert command to the user on a specific day (for example: Sunday)

+3
source share
2 answers

You can schedule your next team Sunday morning

ALTER DATABASE database-name SET READ_ONLY

and this sunday evening

ALTER DATABASE database-name SET READ_WRITE
+1
source

What a strange demand!

If you just want to restrict access to inserts in the same table, create a trigger instead of a trigger and use the day () function to determine the day of the week, and insert if the day is not Sunday. Please note that this will be limited to the server day, not the user day if they are in a different time zone.

+1

Source: https://habr.com/ru/post/1778683/


All Articles