Was bedeutet On Update Cascade?

Was bedeutet On Update Cascade?

ON UPDATE CASCADE Wenn man in der Elterntabelle den Inhalt eines Feldes ändert, dass in der Kindtabelle als Fremdschlüssel definiert wurde, so werden in Letzterer die Fremdschlüsselwerte ebenfalls angepasst.

Was macht Cascade?

CASCADE – die Weitergabe der Änderung an die Detailtabelle. RESTRICT – die Verweigerung der Änderung auch in der Primärtabelle. SET NULL – die Änderung des Verweises in der Detailtabelle auf NULL.

Was ist on Delete Cascade?

ON DELETE CASCADE : Wenn eine Zeile der referenzierten Tabelle gelöscht wird, werden alle übereinstimmenden Zeilen in der referenzierenden Tabelle gelöscht.

What is a cascade update in the database?

ON UPDATE CASCADE means that if the parent primary key is changed, the child value will also change to reflect that. ON UPDATE CASCADE ON DELETE CASCADE means that if you UPDATE OR DELETE the parent, the change is cascaded to the child. Click to see full answer. Just so, what is Cascade update in database?

How to use MySQL cascade on delete and update Cascade?

MySQL ON DELETE and ON UPDATE Cascade Example 1 ON DELETE cascade. 2 Take below Example to understand this. 3 Now Our person and ordes table will look like this. 4 Now try to delete some data from person table. 5 ON UPDATE cascade. 6 Follow the above steps: 3- Insert Data in both tables. 7 Reference

How to create a foreign key with update Cascade?

Similarly, we can create a foreign key with UPDATE CASCADE rule by selecting CASCADE as an action for the update rule in INSERT and UPDATE specifications. Using T-SQL: Please refer to the below T-SQL script which creates a parent, child table and a foreign key on the child table with DELETE CASCADE rule.

What is the use of Cascade on delete?

ON DELETE SET DEFAULT : This cascade is used to set referenced entities value default if we delete the parent table entity. ON DELETE RESTRICT: we can not delete the row from the parent table if it has any referenced row with the same id. ON DELETE NO ACTION: In this cascade, there is no referential delete action performed.

Beginne damit, deinen Suchbegriff oben einzugeben und drücke Enter für die Suche. Drücke ESC, um abzubrechen.

Zurück nach oben