3 ms·
How do you ensure that only one row of only one table references the row of that one table?
by ithkuil 5y ago
How do you ensure that only one row of only one table references the row of that one table?
- alexvoda 5y agoTheoretically, this could also be achived by allowing FKs to Views. But I know of no system that allows this.
- goto11 5y agoMost databases have weak support for cross-table constraints. I believe in SQL Server you can define an indexed view on the union of the tables and then apply a unique constraint on the foreign key.