views and the need?

  • Alright here definateltly the newbie coming out in me here but...

    Views - what is the benefit of them and when is the right time to use them?

  • From Books online

     

    SQL Views

    A view can be thought of as either a virtual table or a stored query. The data accessible through a view is not stored in the database as a distinct object. What is stored in the database is a SELECT statement. The result set of the SELECT statement forms the virtual table returned by the view. A user can use this virtual table by referencing the view name in Transact-SQL statements the same way a table is referenced. A view is used to do any or all of these functions:

    • Restrict a user to specific rows in a table.

      For example, allow an employee to see only the rows recording his or her work in a labor-tracking table.

    • Restrict a user to specific columns.

      For example, allow employees who do not work in payroll to see the name, office, work phone, and department columns in an employee table, but do not allow them to see any columns with salary information or personal information.

    • Join columns from multiple tables so that they look like a single table.
    • Aggregate information instead of supplying details.

    The list goes on and on.

  • I saw that before and I guess I should have been a bit more specific sorry

     

    IS there reallya  benefit to using views in a web application when I am controlling the data they can see through stored procedures anyway?

  • No , not really.

    But is beneficial for things like creating aggregated data in a view. for summarization. But not neccesary.

    I don't generally use views very often.

     

  • thanks

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply