Hi friends
Thank you.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Apr 30, 2012, 6:41 PM EDT
Please refer the below link
http://msdn.microsoft.com/en-us/library/ms187956.aspx
http://cactussoft.com/ITUtopia/?p=36
http://www.java2s.com/Tutorial/SQLServer/0320__View/0140__Updatable-View.htm
Thanks
SenthilkumarRank #387 · 6.5K reputationPosted Apr 30, 2012, 7:33 PM EDT
Sql server view is only updatable when the views comes under only one table.
If the view has joins with the multiple table then it can't update.
For example,
CREATE VIEW VW_Employee
AS
BEGIN
SELECT FirstName,LastName,Address,City,State,Country
FROM Employees
END
If you want to update this then
UPDATE VW_Employee SET FirstName='Senthil', LastName='Kumar',City='BANGALORE',State='Tamilnadu',Country='India'
If the views belongs to multiple table then
CREATE VIEW VW_Employee
AS
BEGIN
SELECT E.FirstName,E.LastName,E.Address,E.City,E.State,E.Country,S.Salary,S.Month,S.Year
FROM Employees E INNER JOIN Salary S ON S.EmployeeID = E.EmployeeID
END
This table can't be updated as well as deleted.