I have two varchar columns (ColA, ColB) in a single table (Table1)
Is there a way to craft a constraint that would prevent the same value from appearing in both ColA and ColB?
Example
Original Table:
-----------------------
| Col A | Col B |
-----------------------
| Alice | Bob |
-----------------------
Insert Command that I would like to fail
Insert into Table1 values ('Bob', 'Jill')
Undesired Result
-----------------------
| ColA | ColB |
-----------------------
| Alice | Bob | <-- Bob In Col B
-----------------------
| Bob | Jill | <-- Bob in Col A
-----------------------
You would need to implement this constraint logic as a
Trigger.