December 2013
Intermediate to advanced
1872 pages
153h 31m
English
Views allow users or developers to focus on the specific data elements they need to work with. Tables that contain hundreds of columns or columns that have limited value for the end user can be filtered with a view such that only the relevant data elements are returned.
The HumanResources.vEmployee view in the AdventureWorks2012 database is a good example of a view that focuses on specific data and simplifies data access. The view definition follows:
CREATE VIEW [HumanResources].[vEmployee]ASSELECT e.[BusinessEntityID] ,p.[Title] ,p.[FirstName] ,p.[MiddleName] ,p.[LastName] ,p.[Suffix] ,e.[JobTitle] ,pp.[PhoneNumber] ,pnt.[Name] AS [PhoneNumberType] ,ea.[EmailAddress] ...