From the course: Microsoft SQL Server 2016 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understanding the advanced options of views

Understanding the advanced options of views - SQL Server Tutorial

From the course: Microsoft SQL Server 2016 Essential Training

Start my 1-month free trial

Understanding the advanced options of views

- [Instructor] In this section, we're going to dive a little deeper into views. In the previous section, we created a new view called City State. That view does not hold data in itself. The view instead looks at the underlying tables when it needs to retrieve data. So if I run a query against the City State view, that view will go look in the City table and then it will go look in the State table and it will return that data to me. There might be some times when I'd like the view to actually hold a copy of the data. That might speed up performance. Rather than the view having to go to the tables to find the data, the view would have the data stored inside of it. This is sometimes called a persisted view. Persisted meaning saved. So we have a saved copy of the data. In order to create a persisted view in SQL Server 2016, we need to add an index to the view. So if I expand the plus sign next to the name of the view, one of the items we see underneath is Indexes. One of the requirements…

Contents