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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SQL View Update

Author  Topic 

mshsilver
Posting Yak Master

112 Posts

Posted - 2012-02-17 : 11:54:22
Hi,

I was wondering if I can update a field in a table through a view.

I have a view joining 3 tables and a third party app that is reading (and wanting to write back) the data from that view. Could I enable the view to except a single field to be updated with an SQL update query? Or do I need to create a second view displaying just the 1 table / field that the field I want to update?

What is the best way to do this?

Thanks for helping.

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-02-17 : 12:08:49
You can update through a view, but there are some restrictions, one of which is that you can update only one underlying table. There are other restrictions - look for the section "updatable views" here: http://msdn.microsoft.com/en-us/library/ms187956.aspx
Go to Top of Page

mshsilver
Posting Yak Master

112 Posts

Posted - 2012-02-17 : 12:18:57
That is just what i was looking for thank you!
Go to Top of Page
   

- Advertisement -