I was trying to figure out if there was a way to do it without every possible combination.
For example, suppose the values available are 2, 4 and 8 (just to keep it simple).
TableValues
ID Value
1 2
2 4
3 8
INSERT INTO TableInput (Flags) VALUES (6)
What I am wondering if there is a way (which I might be answering my own question), to do a check or foreign key constraint on
SELECT SUM(Value) FROM TableValues
& inserted.Flags
etc.
Or something similar...