|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 1:04 AM
Points: 1,191,
Visits: 2,117
|
|
Hi all
Please help me understand the process on Views in SQL Server
Table:
create table viewstest (Col1 int, Col2 int, Col3 int) go insert into viewstest values ('1', '1', '1') ,('2', '2', '2') ,('3', '3', '3') ,('4', '4', '4') ,('5', '5', '5') ,('6', '6', '6') ,('7', '7', '7')
View:
create view [dbo].[VW] as select * from viewstest where Col1 = '1' GO Ok
Why is it that when I update or insert data in the view, it also updates the underlying table?
Is that normal?
Thanks
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 12:38 AM
Points: 37,725,
Visits: 29,981
|
|
Views are just saved select statements. They aren't tables, they don't store data. Where else would the changes go when you update a view?
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|