Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Updating data in a view

Author  Topic 

uniquegodwin
Starting Member

12 Posts

Posted - 2007-10-02 : 21:45:44
Hello everyone,
Can someone help me with updating data into a view using triggers?
I am struggling hard to write a trigger or stored procedure to update the values on the base tables of the view.
Please help me out...
Thanks,
Godwin

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-10-02 : 22:05:46
What's your problem? Is the view updatable? Can you post your code?
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2007-10-03 : 01:26:42
check with the views wether those are with schema binding option or not?

Vinod
Even you learn 1%, Learn it with 100% confidence.
Go to Top of Page

renu
Starting Member

47 Posts

Posted - 2007-10-03 : 02:46:36
hi it is generally given as the views can be updatable only if it is from the single table .view is not updatable if there ar multiple columns from multiple tables.can anyone say with an example.i tried with both scenario .in both sense i am getting as views can be updatable.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-10-03 : 22:12:01
Any modifications, including UPDATE, INSERT, and DELETE statements, must reference columns from only one base table. That means the view can have coulmns from multiple tables, but columns modified must be in same table.
Go to Top of Page

sunsanvin
Master Smack Fu Yak Hacker

1274 Posts

Posted - 2007-10-04 : 05:46:37
Follow this article.....

http://www.sql-server-performance.com/articles/dba/view_basics_p1.aspx


Vinod
Even you learn 1%, Learn it with 100% confidence.
Go to Top of Page
   

- Advertisement -