How to script a constraint on a field in a table, for an acceptable range of values is between 0 and 100?
ALTER TABLE Table
ADD CONSTRAINT CK_Table_Column_Range CHECK (
Column >= 0 AND Column <= 100 --Inclusive
)
A check constraint like "fieldname BETWEEN 0 AND 100" should do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With