SQL server foreign key constraint
SQL Server
常見的 SQL server 的 foreign key constraint,通常使用在 ON UPDATE 和 ON DELETE 的設定,有以下幾種 Referential Actions:
CASCADE:不同於 SET NULL 和 SET DEFAULT,會修改 foreign key 欄位得值。此設定會在 parent 資料被刪除的時候,將關聯的資料也一並刪除。
NO ACTION:預設設定。產生一個錯誤,宣告 delete 或 update 會造成 for...
blog.taiwolskit.com1 min read