What Is The Purpose Of Views In Sql Server ?

Posted by Kasani007 under Sql Server on 10/8/2014 | Points: 10 | Views : 562 | Status : [Member] | Replies : 3
What Is The Purpose Of Views In Sql Server ?




Responses

Posted by: vishalneeraj-24503 on: 10/8/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
As Views are treated as Temp table so if we want to manipulate table data but not on original tables,then we can use Views.And data modification in Views does not impact on original tables.

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 10/9/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
View is a virtual table for the original table. It doen't store the physical data in memory, just stores query which is used while creating view.

Puporse of View:
The manipulations in views will impact dependent base tables. It depends on the type of view.

Some examples to use the Views in SQL Server are:
1. Maintaing sensitive data: if u have any sensitive data as part of a table and u does not want to reveal/access sensitive data to some users then u can consider views.
Solution: create view by removing sensitive columns and grant view access to the users

2. Cross-database manipulations : you can refer other database objects in the view and the view manipulations will effect the base tables

Use Database1
GO
CREATE VIEW vw_TestSample
AS
SELECT Col1, col2 FROM Database2.dbo.SampleTable
GO


The view manipulations on the above view( it is in database1) will effect the base table SampleTable in database2

Refer the below link for knowing the purpose of Views in SQL Server
http://www.toadworld.com/platforms/sql-server/w/wiki/10274.views-advantages-and-disadvantages.aspx
C




Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Kasani007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response