Database Reference
In-Depth Information
10. To see how updating a view will impact the underlying table, enter the following SQL
statement. Before the execution of the UPDATE SQL statement, you need to use the
ALTER TABLE statement to disable the triggers created on the table STUDENT_
CLASS. Later, you can enable the triggers.
ALTER TABLE STUDENT_CLASS DISABLE TRIGGER Class_Checking, Drop_
Class
GO
UPDATE STUDENT_GRADE_VIEW
SET GRADE = 'A'
WHERE StudentID = 11 AND ClassID = 1000
11. Figure 8.13 shows that the update is done.
12. To check if the table is updated accordingly, enter the SQL statement as shown in
Figure 8.14. As seen in Figure 8.14, the table STUDENT_CLASS is updated.
13. In the next step, we will update the view STUDENT_ADVISOR_VIEW (which
contains a calculated column) with the following SQL statement:
UPDATE STUDENT_ADVISOR_VIEW
SET GPA = 3.0
Where FirstName = 'Don' AND LastName = 'Ford'
14. Figure 8.15 shows that the update is prevented because the view contains a calculated
column.
Figure 8.13
Update STUDENT_GRADE_VIEW.
Search WWH ::




Custom Search