开发者

create trigger to restrict access on particular day

开发者 https://www.devze.com 2023-01-29 14:03 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消