关于外键约束。
有两个表A和B,表B中的一个数据项与表A的主键外键关联。
当用表A的主键做为条件删除表A的某一记录时,如果表B中有关联的记录,则显示:
DELETE statement conflicted with COLUMN REFERENCE constraint 'fk_ts_log_operatorid'. The conflict occurred in database 'SHIPPING', table 'B', column 'operatorid'.
The statement has been terminated.
增加触发器也不管用:
CREATE TRIGGER del_A on A for delete
AS
delete B from deleted where B.operatorid = deleted.operatorID
仍然出现上面提示。
我如何才能实现,再删除A时,对应的B记录也能删除。