Chapter 11

Projecting Data Through Views

In This Chapter

Planning Views Wisely

Creating Views with Management Studio or DDL

Updating Through Views

Considering Performance and Views

Using Nesting Views

Exploring Security through Views

Learning Synonyms

A view is the saved text of a T-SQL SELECT statement that may be referenced as a data source within a query, similar to how a subquery can be used as a data source—no more, no less. A view cannot be executed by itself; it must be used within a query.

Views are sometimes described as “virtual tables.” This isn't an accurate description because all views do not store any data. Views that are indexed are materialized and actually store data. If they are not indexed, they are like any other SQL query; views merely refer to the data stored in tables.

With this in mind, you need to fully understand how views work, the pros and cons of using views, and the best place to use views within your project architecture.

Get Microsoft SQL Server 2012 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.