I've inherited a database that has several inconsistencies in the data. I'm trying to work to block some of these using check constraints.
I have a single table where all values are nullable, but the logic requires that one of two (datetime) columns (at a minimum) be null. Both can be null, but if one has a date in it, the other cannot have a date in it. I'm trying to figure out a way to enforce this through constraints. I am trying to avoid using an indexed view because they're really a pain for me. I was hoping there was a way to write a check constraint to prevent this.
Thanks in advance.