cascading deletes causing multiple cascade paths

后端 未结 3 1734
情书的邮戳
情书的邮戳 2020-12-11 20:31

I am using SQlServer 2008, and an extract of some datatables is displayed below:

Users

Id (PK)

UserItems

UserId (PK) ItemId (PK) - (Compo

3条回答
  •  执笔经年
    2020-12-11 20:56

    I would lead toward bad design. While most DBMSs can manage cascading deletes, it is risky to use this built in functionality. Your scenario is a perfect example of why these types of things are often managed in application code. There you can determine exactly what needs to be deleted and in what order.

提交回复
热议问题