Cascading referential integrity constraint in SQL Server- PART 5

preview_player
Показать описание
We tried to explain Cascading Referential Integrity, please like, share and subscribe:

Please refer to the definition below:

The Foreign Key constraint enforces referential integrity by guaranteeing that changes cannot be made to data in the primary key table if those changes invalidate the link to data in the foreign key table. If an attempt is made to delete the row in a primary key table or to change a primary key value, the action will fail when the deleted or changed primary key value corresponds to a value in the FOREIGN KEY constraint of another table. To successfully change or delete a row in a FOREIGN KEY constraint, you must first either delete the foreign key data in the foreign key table or change the foreign key data in the foreign key table, which links the foreign key to different primary key data.

Syntax:

The REFERENCES clauses of the CREATE TABLE statements support the ON DELETE and ON UPDATE classes:
-ON DELETE (NO ACTION CASCADE I SET NULL I SET DEFAULT)
-ON UPDATE (NO ACTION I CASCADE I SET NULL I SET DEFAULT)
Рекомендации по теме
Комментарии
Автор

helpful for understanding the cascading

SumanSharma-idwi
welcome to shbcf.ru