| Start |
|---|
| CREATE Indexed VIEW To create a view with an index, the view must be created using the Any clustered or non-clustered indexes can be now be created: There Are some limitations to indexed Views: For more information about creating indexed Views you can read this MSDN article (opens new window) |
CREATE VIEW Rows from views can be selected much like tables: You may also create a view with a calculated column. We can modify the view above as follows by adding a calculated column: This view adds an additional column that will appear when you |
CREATE VIEW With Encryption |
CREATE VIEW With INNER JOIN Views can use joins to select data from numerous sources like tables, table functions, or even other views. This example uses the FirstName and LastName columns from the Person table and the JobTitle column from the Employee table. This view can now be used to see all corresponding rows for Managers in the database: |
| Grouped VIEWs A grouped VIEW is based on a query with a GROUP BY clause. Since each of the groups may have more than one row in the base from which it was built, these are necessarily read-only VIEWs. Such VIEWs usually have one or more aggregate functions and they are used for reporting purposes. They are also handy for working around weaknesses in SQL. Consider a VIEW that shows the largest sale in each state. The query is straightforward: https://www.simple-talk.com/sql/t-sql-programming/sql-view-beyond-the-basics/ (opens new window) |
| UNION-ed VIEWs VIEWs based on a UNION or UNION ALL operation are read-only because there is no single way to map a change onto just one row in one of the base tables. The UNION operator will remove duplicate rows from the results. Both the UNION and UNION ALL operators hide which table the rows came from. Such VIEWs must use a , because the columns in a UNION [ALL] have no names of their own. In theory, a UNION of two disjoint tables, neither of which has duplicate rows in itself should be updatable. https://www.simple-talk.com/sql/t-sql-programming/sql-view-beyond-the-basics/ (opens new window) |
Read Article
https://develop.horje.com/learn/1434/reference