Are Views automatically updated

前端 未结 6 1416
谎友^
谎友^ 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 06:07

    Yes, records will be updated every time.

    But if you modify table definition. Don't forget to refresh view.

    exec sp_refreshview @viewname

    Don't use SELECT * in view definition, instead use column name

提交回复
热议问题