3 ms·
Your code enforces consistency and detects when a transaction fails the consistency rule rolls back the changes to the state when the transaction started? That'
by chris_wot 10y ago
Your code enforces consistency and detects when a transaction fails the consistency rule rolls back the changes to the state when the transaction started? That's some great code I'm sure, but a lot of effort.
The only limitation on an SQL check constraint is that you cannot use columns in other tables.
As has been pointed about by many of us slow learners, it's far easier to understand constraints in SQL than it often is to dive into a code base.