开发者

Need Help with a Trigger for preventing a circular reference on a table

开发者 https://www.devze.com 2022-12-20 07:31 出处:网络
We currently have a table that looks like this: ChildId|ParentID ------------------ 1| NULL 2| NULL 3| 1 4| 3

We currently have a table that looks like this:

ChildId    |  ParentID
------------------
1          | NULL
2          | NULL
3          | 1
4          | 3

Can anyone help me come up with a constraint/trigger that would开发者_运维问答 prevent a circular reference from being inserted or updated into the table?

Thanks


You will need to create a trigger.

0

精彩评论

暂无评论...
验证码 换一张
取 消