Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The reason for not being able to include CURDATE() in a check is that CURDATE() is a dynamic function that returns the current date, and that value is not constant. CHECK constraints need to be based on static conditions that can be evaluated at the time of insertion or update, and the use of dynamic functions may lead to unexpected results as the condition may change over time. Therefore, it is recommended to use static values or expressions in CHECK constraints.