📜  在删除外键时删除其他表中的相应行 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:59.047000             🧑  作者: Mango

代码示例1
ALTER TABLE ReferencingTable DROP 
   CONSTRAINT fk__ReferencingTable__MainTable;

ALTER TABLE ReferencingTable ADD 
   CONSTRAINT fk__ReferencingTable__MainTable 
      FOREIGN KEY (pk_col_1)
      REFERENCES MainTable (pk_col_1)
      ON DELETE CASCADE;