.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

Can we update the data in a view?

Posted By: Dhivakaran     Posted Date: October 29, 2010    Points:2   Category :Sql Server
Can we update the data in a view?

Responses
Author: Ramesh P             
Posted Date: October 29, 2010     Points: 5   

Yes. We can update the data in a view.

Regards,


Ramesh

Author: Santosh             
Posted Date: October 29, 2010     Points: 5   

Hi Dhivakaran

Yes,u can update only the base(main) table column of the view.

Ex:if there r four tables r joining in view,
in this case only u can update the columns which is from main table but remaining 3 tables column values u can't update...



Regards
Santosh

Author: Deco             
Posted Date: October 29, 2010     Points: 5   

For this criteria only, the indexed view in being introduced in Sql server 2008 :-)

Regards,
Deco
Author: Asha.MP             
Posted Date: November 01, 2010     Points: 5   

Hi..

Not possible to update the view directly i mean the views are the reflection of the tables.
By Updating the tables which are used to create that view, view will take that updated value.
ex:

considar ViewDetails is a view which contains Emp and Company table, if you want to update the view to change the name of an Employee in Emp table, you need to update that name in Emp table and not in view.

Thanks and Regards,
Asha.mp
Author: sriram             
Posted Date: October 27, 2011     Points: 20   

yes we can update in a view.

update emp_view set empname='sdss' where empid=101

Regards
Sriram.r


www.databaseresource.blogspot.com



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend