Feed on
Subscription

Technology of SQL Server database (91)

View and watch have similar structure,When be inserted to the middle of view or updating data,Carry out data to the watch that view place cites actually insert and update.But insert through view, newer data and watch photograph are restricted than having a few,Be told about below through specific example insert through view, newer data and the restriction that its use.



Statement of use SELECT,This record can be examined in view and watch.But if carry out the statement below,Although still can be carried out successfully,But express and can not not be only this data is examined in view.



Notice:Because insert data essence to view,be data is inserted in the basic watch that cites to its,Must affirm those will include to be listed in view so but the kind that attributes a watch allows NULL to be worth or default is worth.



If want to carry out INSERT statement,Be in same a statement can same to belonging to the row of a watch executes an operation.So,If insert one linage to the middle of view Au_title,occupy,Can carry out the following statement respectively only:Insert Into Au_title (author_au_id, au_lname, au_fname, contract)Values ('234-34-4611' , 'John' , 'Smith' , 1)Insert Into Au_title (title_au_id, title_id, au_ord, royaltyper)Values ('234-34-4611' , 'BU1111' , 1, 50)
Make updating notice two issues with the need when deleting to data through view:
When executive UPDATE DELETE,Be deleted with updated data,Must include center in view result;
If view cites when many watches,Cannot delete data with DELETE command,If use UPDATE to answer like INSERT operation,Must be belonged to by newer line same a watch.

Related:

    收藏到网摘:

    Submit: