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
 View to a table

Author  Topic 

zardooloi
Starting Member

2 Posts

Posted - 2009-06-11 : 13:10:27
I have two tables which I am using to create a view. I need to be able to update that data, so I would like to turn the view into a table(because I only need to update some of the data from each table). Is that possible? Or how can I update a view with c# in a visual studio application?

Any suggestions would be appriciated.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-06-11 : 13:14:30
a view becomes updatable only if it follows certain conditions like below

http://www.cvalde.net/features/f4/updatable_views.htm

you can however make it updatable by writing an instead of update trigger on it to fire update directly on base tables.
Go to Top of Page

zardooloi
Starting Member

2 Posts

Posted - 2009-06-11 : 14:04:23
Thanks. That is good news, I hope.

I am building a .net app and I'll need to be able to call the trigger from the webpage (Push the Update button). I have read that you cannot do that.

Which means that I would have to INSERT in the underlying tables. The problem is that I have to insert into two different tables and one of my base table has twice as many columns, which are not necessary, hence the view.


quote:
Originally posted by visakh16

a view becomes updatable only if it follows certain conditions like below

http://www.cvalde.net/features/f4/updatable_views.htm

you can however make it updatable by writing an instead of update trigger on it to fire update directly on base tables.

Go to Top of Page
   

- Advertisement -