I have a table where there are two columns: RowType (INT) and RefId (INT). The value of both columns are zero or more.
I need to check:
If RowType == 1 Then RefId cannot be = 0
What is the best way to do it ?
As I see I can check
CREATE TABLE (
...
CONSTRAINT MyCheck CHECK (RowType + RefId <> 1)
to do it, but may be the is a more general way for such checkings ?