How much space does a view take up in Microsoft SQL Server

笑着哭i 提交于 2019-12-08 16:23:06

问题


I have a very large table in SQL Server 2008. It has lots of fields which are only useful to a certain segment of users, some of the fields some users shouldn't be able to see.

The table is huge so I wanted to create some simple views for each user class where I could give them access to the view and they could only see the columns they need.

Does a view take up space in the database, or would it be saved as a simple select statement?


回答1:


Unless the view is indexed, it takes up almost no space, except for the definition of the view. The view itself is not like a table in that it physically stores rows in the database (unless it is an indexed view). It is only materialized (retrieves data) when it is called



来源:https://stackoverflow.com/questions/4347340/how-much-space-does-a-view-take-up-in-microsoft-sql-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!