Discussion Forum | Board Infinity

When do we use on delete set null and on delete cascade?

,

Sql, Set

  • ON DELETE SET NULL: SQL Server sets the rows in the child table to NULL if the corresponding rows in the parent table are deleted.
  • ON DELETE CASCADE: SQL Server deletes the rows in the child table that is corresponding to the row deleted from the parent table.