updating views

  • Hi all,

    I am a newbie to sql . i want to knw more on views. I know the main purpose of views is for security purpose, not letting table column details expose to evryone.Then why it is updatable..?

    I have a view with some date column.i updated this column with getdate().the same is reflected (updated) in table..

    Could someone pls let me understand more on views

  • I would recommend books online.

    http://msdn.microsoft.com/en-us/library/ms187956.aspx

  • Views aren't just for security. They're basically a mechanism that is used to mask structures. This may be for security. It may also be for backwards compatibility for an application. It also provides a way to store a query in a form that can be queried, as opposed to a stored procedure that must be executed, two different actions. Not all views are updatable. There are rules about when this is possible. I'd suggest reading through the Books Online for a more complete overview on views, including the rules on updates.

    Just don't fall into the trap of over-using views. A view which calls other views or joins views together can frequently lead to very bad performance problems.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 2 (of 2 total)

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