Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we update the data in the view

Tags:

sql-server

  1. Can we update the data in the view.If so, will it reflect the data in the actual table.
  2. Can we delete the table if the view created on that table exists.?

Could any one explain me the above stuff. I am confused with above concepts.

like image 379
Shine Avatar asked Aug 09 '11 09:08

Shine


1 Answers

  1. A view always reflects underlying table data. There are rules and exceptions for updating via views, so see "Updatable Views" in CREATE VIEW

  2. Yes. To prevent this, use WITH SCHEMABINDING in the view (see link above)

like image 157
gbn Avatar answered Oct 07 '22 22:10

gbn