Quote:
Originally Posted by Wedgetail
However, I need to apply the second constraint only if NOT(OfficeID IS NULL).
|
you're fine the way it is
just ensure that the PK of ContactOffice is (ContactID,OfficeID)
since PKs must be not null, therefore (ContactID,OfficeID) in PhoneNumber can only reference ContactOffice when both columns are not null
if OfficeID is null, then the FK to ContactOffice doesn't apply