I have two columns on a table I am concerned with. If both columns are null, that's ok. If they are both not null, that's ok. But if column one is not null, column two can't be null. Is there a way to add this type of constraint?
Asked
Active
Viewed 107 times
1 Answers
0
This seems like a clear case of unwisely overloading two different types of thing into the same table. The solution is to put the two attributes in question into a new table (and make them non-nullable). Reference your current table with a foreign key in the new table.

nvogel
- 24,981
- 1
- 44
- 82