In SQL Server, ON DELETE NO ACTION
is an option that we can apply to foreign key constraints to prevent the deletion of a row in the parent table if there are related rows in the child table.
Unlike ON DELETE CASCADE
, which would delete the related rows in the child table, NO ACTION
enforces that if a deletion would result in orphaned records in the child table, the deletion operation is prohibited, and an error is raised.