Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 23 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
23
Dung lượng
220 KB
Nội dung
Session 3Implementing and Managing Views
ReviewIntroduction to IndexesIndex ArchitectureRetrieving Stored DataFinding RowsVarious Types of IndexesWorking with IndexesViewing Index Information
Session ObjectivesIntroduction to ViewsDefining ViewsExploring CREATE VIEW optionsModifying data through Views
Introduction to ViewsA view is a virtual table that is made up of selected columns from one ore more tables.A view can include columns from other viewThe data inside the view comes from the base tables that are referenced in the view definition
Type of ViewsStandard View: using columns from one or more tablesIndexed View: with a unique clustered indexPartitioned View: a view created using horizontally partitioned data from one or more tables
Advantages of viewsSecurity through Personal AccessCustomized Display of DataMerger of Data from Multiple Tables or ViewsOperations on RecordsIntegrity Constraint Checks
System ViewsTypes of System Views: Catalog Views Information Schema Views Compatibility Views Replication Views Dynamic Management Views Notification Services Views
Creating ViewsSyntax:CREATE VIEW <view_name>AS <select_statement>Sample:CREATE VIEW Salary_Details ASSELECT EmpID, FirstName, LastName, Salary FROM Employee_Details
Creating ViewsPermisions to create views:Sysadmin roleDb_ownerDb_ddladminCreate view permisionSelect permission on all tables
Alter ViewsA view can be altered by dropping and recreating it or using Alter viewSyntax:ALTER VIEW <view_name>AS <select statement>Sample:ALTER VIEW Salary_Details AS SELECT * FROM Employee_Details WHERE EmpID=1
123doc.vn