Professional Documents
Culture Documents
Designing and Implementing Views
Designing and Implementing Views
Introduction to Views
Creating and Managing Views
• Performance Considerations for Views
Lesson 1: Introduction to Views
What Is a View?
Types of Views
Advantages of Views
Dynamic Management Views
Other System Views
• Demonstration: Querying Catalog Views and
DMVs
What Is a View?
• User-defined views:
• Views (sometimes called standard views)
• Indexed views
• Partitioned views
• System views:
• System catalog views
• Dynamic management views (DMVs)
• Compatibility views
• Information schema views
Advantages of Views
• Catalog views:
• Views onto internal system metadata
• Organized into categories, such as object views,
schema views, or linked server views
• Compatibility views:
• Provide backward compatibility for SQL Server 2000
system tables
• Do not use for new development work
Create a View
Drop a View
Alter a View
Ownership Chains and Views
Sources of Information about Views
Updateable Views
Hide View Definitions
• Demonstration: Creating, Altering, and Dropping a
View
Create a View
• Use Transact-SQL:
• sys.views – lists views in database
• OBJECT_DEFINITION() – returns the definition of non-
encrypted views
• sys.sql_expression_dependencies – lists objects,
including other views, that depend on an object
Updateable Views
• Advantages include:
• Once a view has been written, tested, and documented,
it can be used just like a table
Partitioned Views
Logon Information
Virtual machine: 20762C-MIA-SQL
User name: AdventureWorks\Student
Password: Pa55w.rd
• Review Question(s)