how to create trigger to restrict the insert command access from the user on particular day(eg:sund开发者_运维知识库ay)
You could schedule following command sunday morning
ALTER DATABASE database-name SET READ_ONLY
and this sunday evening
ALTER DATABASE database-name SET READ_WRITE
What an odd requirement!
If you just want to restrict access to inserts on one table, create an instead of trigger and use the day() function to determine the day of the week it is and do the insert if the day is not Sunday. Note this will be restricted to the server day not the users day if they are in a different time zone.
精彩评论