CASCADE Delete in many-to-many self-reference table

后端 未结 1 643
隐瞒了意图╮
隐瞒了意图╮ 2020-12-19 16:30

Table DISPLAY_TAB below is a self-reference table that can contain both parent and child tabs. A parent tab can have multiple child tabs and a child tab can

相关标签:
1条回答
  • 2020-12-19 17:04

    Read this KB article, which says the following among other things...

    You receive this error message because in SQL Server, a table cannot appear more than one time in a list of all the cascading referential actions that are started by either a DELETE or an UPDATE statement. For example, the tree of cascading referential actions must only have one path to a particular table on the cascading referential actions tree.

    To do what you want, the DISPLAY_TAB_GROUPING table would have to appear twice. I suggest you use a stored proc that implements your delete code instead.

    0 讨论(0)
提交回复
热议问题