I have a table that allows users to specify a tollerance by an absolute value or by a percentage
e.g. they could say +/- 1,000,000
or 10%
so I have a table with a column for each value
What is th best way to ensure that only one or the other gets specified, not both
I will be adding validation to my UI, but would also like this checked by the database
Some kind of custom constraint?
A CHECK constraint
This assumes your 2 columns are called
ABSValueandPercentValueand both nullable. If they are nullable (they should be), change the check to your sentinel (N/A) value