14

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?

Great Turtle
  • 3,315
  • 7
  • 32
  • 36

1 Answers1

27

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

Randy Minder
  • 47,200
  • 49
  • 204
  • 358
  • 2
    +1 - It may help the OP to think about the view as a query that you can refer to as a table. – JNK Dec 03 '10 at 16:10
  • Thank you. I wasn't sure if temporary tables might be created behind the scenes or something that wasn't visible. – Great Turtle Dec 03 '10 at 17:20