Chapter 3 PHYSICAL DATABASE DESIGN AND IMPLEMENTATION 143
Chapter 3 PHYSICAL DATABASE DESIGN AND IMPLEMENTATION 143 FIGURE 3.7 Primary Key/Foreign Key referential integrity. Using Cascade Action to Maintain Integrity New to SQL Server with the 2000 release is a cascading action feature that many other database environments have been enjoying for quite some time. Cascading actions affect update and delete activity where an existing Foreign Key value is changed or removed. Cascade action is controlled through the CREATE and ALTER TABLE statements, with clauses for ON DELETE and ON UPDATE. You can also select these features using the Enterprise Manager. In a cascading update, when you change the value of a key in a situation where a Foreign Key in another table references the key value, those changed values are reflected back to the other tables. A similar thing happens with a delete operation: if a record is deleted, then all subsidiary records in other tables are also deleted. For example, if an invoice record is deleted from an invoice table that has invoice details stored in another table and referenced by a Foreign Key, then the details would also be removed. A series of cascading actions could easily result from the update or deletion of important keys. For example, the deletion of a customer could cause the deletion of all that customer s orders, which could cause the deletion of all its invoices, which in turn could cause the deletion of all the customer s invoice details. For this reason, careful system design is important and the potential archival of data through the use of triggers should be considered. In the case of multiple cascading actions, all the triggers to be fired by the effects of the original deletion fire first. AFTER triggers then fire on the original table and then the AFTER triggers in the table chain subsequently fire. TIPEXAM Cascading Actions Is a New Feature You can expect that something about it will be asked on the exam. Also be prepared for the exam by knowing all the results and implications of cascading actions. For example, you might be asked what occurs when a record contained in the parent table is deleted, or has its key value changed.
If you looking for unlimited one inclusive web hosting plan please check cheap web hosting website.