How to put foreign key constraints on a computed fields in sql server?
- by Asaf R
Table A has a computed field called Computed1. It's persisted and not null. Also, it always computes to an expression which is char(50). It's also unique and has a unique key constraint on it.
Table B has a field RefersToComputed1, which should refer to a valid Computed1 value.
Trying to create a foreign key constraint on B's RefersToComputed1…