Answer the question
In order to leave comments, you need to log in
How to create a trigger to restrict CREATE statements at night?
There is a need to create a trigger to restrict the execution of CREATE statements at night. I understand how to write a "night time" condition, but I don't understand how to impose a restriction on the execution of CREATE statements.
In the trigger definition syntax, there is no way to select the SQL CREATE event (by the way, I need the operator itself, not the event).
Answer the question
In order to leave comments, you need to log in
You want to approach the problem from some very wrong side. The question to which you need to look for an answer is - why do you want it?
In a normal form, you don’t have such a task at all already at the rights level - DDL is prohibited at all for the application user. And for people - it is solved not by technical means, but organizationally. That is, there is no access to the product at any time of the day to change the scheme by people (and, in fact, to read by people too, for people access to a non-combat replica), who are not responsible for the consequences of their actions. And for specialists who should have access, it’s strange to put up obstacles, even during the day, even more so at night (when critical things can roll out).
However, event triggers can be ddl_command_start for a number of create commands.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question