420 Part I EXAM PREPARATION DELETE FROM TitleAuthors
420 Part I EXAM PREPARATION DELETE FROM TitleAuthors WHERE au_id = 213-46-8915 GO Server: Msg 4405, Level 16, State 1, Line 1 View or function TitleAuthors is not updatable because the modification affects multiple base tables. Another requirement for deleting data through a view is that the data specified in the DELETE statement must actually be visible in the view. For example, the following shows the creation of a view, and an attempted data deletion using state as part of the deletion criteria while it is not part of the view. This fails with the specified error. CREATE VIEW AuthorsInCA AS SELECT au_id, au_lname, au_fname FROM authors WHERE state = CA GO DELETE FROM AuthorsInCA WHERE au_lname = Burns and state .= CA GO Server: Msg 207, Level 16, State 3, Line 1 Invalid column name state . If the view was created with the state column visible, then the DELETE statement would have succeeded. All components of the DELETE statement must be defined in the view. The last requirement for deletion of data through a view is that the deletion of the record may not cause any foreign key violations. This type of deletion would not have been allowed outside the view, so it is not allowed through the view either. For example, in the Pubs database, you are not allowed to DELETE an author record if that author is assigned to a blog, because the FK_Constraints are declared on the TitleAuthor table with the Authors table. To DELETE a row through a view, go through the Step by Step 7.6. STEP BY STEP 7.6 Deleting a Row via a View
For high quality website hosting services please check tomcat web hosting website.