Skip to content Skip to sidebar Skip to footer

Cascade Delete In Many-to-many Self-reference Table

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 belong to multiple pare

Solution 1:

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.

Post a Comment for "Cascade Delete In Many-to-many Self-reference Table"