自引用外键SQL Server DeleteAction不起作用

问题描述

| 我有一个带有自引用外键的表,其中DeleteAction设置为Cascade,但是当删除Parent时,没有子级(直接或后代)不会删除。 我想念什么?     

解决方法

        您不能在自引用表上使用级联删除。 检查此链接以获取可能的解决方案。     ,        要使用删除级联,请使用以下创建表脚本... 创建 表 test_child ( SUB1 INT,[NO] int,外键([NO])参考Test_parent 上 删除级联 ) 选中此链接以获取更多信息: http://msdn.microsoft.com/en-us/library/ms186973.aspx     

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...