Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 360
Great Turtle Avatar asked Dec 03 '10 16:12

Great Turtle


1 Answers

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

like image 73
Randy Minder Avatar answered Oct 23 '22 01:10

Randy Minder