Designing a conditional database relationship in SQL Server

前端 未结 7 1125
日久生厌
日久生厌 2020-12-15 11:29

I have three basic types of entities: People, Businesses, and Assets. Each Asset can be owned by one and only one Person or Business. Each Person and Business can own from

7条回答
  •  一个人的身影
    2020-12-15 12:17

    YOu can enforce the logic with a trigger instead. Then no matter how the record is changed, only one of the fileds will be filled in.

    You could also have a PeopleAsset table and a BusinessAsset table, but stillwould have the problem of enforcing that only one of them has a record.

提交回复
热议问题