.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

how to Update a view in Sql Server

Posted By: Deco     Posted Date: October 11, 2010    Points:2   Category :Sql Server
Please guide me step by step on how to update a view in sql server...

Responses
Author: Jean Paul             
Posted Date: October 13, 2010     Points: 5   

Step1: Create two tables TableA and TableB with your own columns

Step2: Create a view using the query
SELECT * FROM TableA

Step3: Modify the view using query
ALTER VIEW MyView AS SELECT * FROM TableB

In this example the view "MyView" was updated on executing Step3. Hope this would provide the answer :)

Jean Paul http://jeanpaulva.com/
Author: Ramesh P             
Posted Date: October 30, 2010     Points: 5   

We can update a view If it is created from a single table.

UPDATE [Ramesh].[dbo].[vw_empdetails]
SET [empid] = <empid, int,>
,[empname] = <empname, varchar(50),>
WHERE <Search Conditions,,>

We have to use instead of trigger to update a view If it is created from multiple table.

Regards,


Ramesh



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