我有扳机 trig_1
我想从表中删除一些内容 tbl_1
但是sql抛出了一个关于 tbl_1
以及 tbl_2
.
如何禁用外键、执行删除操作并重新启用外键?
create trigger trig_1
on tbl_1
for delete
as
begin
delete from tbl_2
where tbl_2.ID = ID // ID is from tbl_1 and it's a foreign key
end
我有扳机 trig_1
我想从表中删除一些内容 tbl_1
但是sql抛出了一个关于 tbl_1
以及 tbl_2
.
如何禁用外键、执行删除操作并重新启用外键?
create trigger trig_1
on tbl_1
for delete
as
begin
delete from tbl_2
where tbl_2.ID = ID // ID is from tbl_1 and it's a foreign key
end
暂无答案!
目前还没有任何答案,快来回答吧!