A question about updatable db views: I'm reading through some MSDN documentation on the subject, and I come across the following restriction:
Any modifications, including UPDATE, INSERT, and DELETE statements, must reference columns from only one base table.
I just want to be sure I understand the restriction. I'd like to use views in a couple of my media review projects. The relational data is spread throughout tables, but a view seems to be the best way to be able to consolidate the data I need from multiple tables (some of which are linked via foreign keys) into a centralized location. Since the columns would come from a variety of tables, does this mean I can't run one blanket INSERT or UPDATE to persist changes in all the columns?
You can use an INSTEAD OF trigger on a view to keep your application only dealing with the view instead of the collection of base tables the view references.
Here is an example : Designing INSTEAD OF Triggers
Yes that's what it means. I see no advantage to updating through a view since you have to know what the base tables involved are anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With