What are the downsides of using SqlServer Views?

后端 未结 10 1324
情歌与酒
情歌与酒 2020-12-29 05:04

What are the downsides of using SqlServer Views?

I create views frequently to show my data in a denormalized form.

I find it much easier and therefore fas

10条回答
  •  北荒
    北荒 (楼主)
    2020-12-29 06:04

    What are Various Limitations of the Views in SQL Server?

    Top 11 Limitations of Views

    • Views do not support COUNT (); however, it can support COUNT_BIG ()
    • ORDER BY clause does not work in View
    • Regular queries or Stored Procedures give us flexibility when we need another column; we can add a column to regular queries right away. If we want to do the same with Views, then we will have to modify them first
    • Index created on view not used often
    • Once the view is created and if the basic table has any column added or removed, it is not usually reflected in the view till it is refreshed
    • UNION Operation is not allowed in Indexed View
    • We cannot create an Index on a nested View situation means we cannot create index on a view which is built from another view.
    • SELF JOIN Not Allowed in Indexed View
    • Outer Join Not Allowed in Indexed Views
    • Cross Database Queries Not Allowed in Indexed View

    Source SQL MVP Pinal Dave

    http://blog.sqlauthority.com/2010/10/03/sql-server-the-limitations-of-the-views-eleven-and-more/

提交回复
热议问题