What is a view? is View updatable?

Answer Posted / suraj

-- Views are updatable regardless of the number of
tables involved in that view.
-- Data contained in the base tables are updated when
VIEWS are updated.



drop table t1
drop table t2
drop view t1t2

create table t1(ID int, FirstName varchar(20))
create table t2(ID int, LastName varchar(20))

insert t1 values(1,'John')
insert t1 values(2,'Mike')
insert t2 values(1,'Smith')
insert t2 values(2,'Shres')

create view t1t2
as
select t1.FirstName, t2.LastName
from t1 inner join t2 on t1.ID=t2.ID


update t1t2
set FirstName='Steve' where LastName='Smith'


select * from t1t2
select * from t1

Is This Answer Correct ?    12 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to provide values to user defined function parameters?

568


How do I make a resultset scrollable?

529


What are constraints in microsoft sql server?

572


Difference between Sql server reporting services and Crystal reports?

124


Explain the steps to use transact-sql cursor?

530






What do you mean by an execution plan? How would you view it?

504


What is not null constraint?

634


Create and insert into temp table in sql server?

591


What xml support does the sql server extend?

542


What type of locking occurs during the snapshot generation? : sql server replication

874


What are the acid properties?

560


How to recompile stored procedure at run time?

575


Should you normalize audio?

536


What do you know about normalization and de- normalization?

473


How to create an index on a view?

592