Are Views automatically updated

前端 未结 6 1458
谎友^
谎友^ 2021-02-02 05:40

If I JOIN or CROSS APPLY two tables and create a VIEW, will the view automatically gets updated when I update either of the two tables or

6条回答
  •  生来不讨喜
    2021-02-02 05:43

    Phtttt for what its worth 7 years later I went with what Neville Kuyt Oct 13 '11 at 14:07 recommended.

    Some silly interview moments ago asked if data gets updated in the OG table if you update the view. I figured yea. So after interview I tested it. Created simple View from a some simple table. Wrote a simple update statement to update a column's value where PKId= whatever, then did selects against both the View and the OG table and column is updated in both result sets. Thus Yes you will update original table content from updating the view.

提交回复
热议问题