Why is using '*' to build a view bad?

后端 未结 14 2164
执念已碎
执念已碎 2020-11-27 07:02

Why is using \'*\' to build a view bad ?

Suppose that you have a complex join and all fields may be used somewhere.

Then you just have to chose fields needed

14条回答
  •  失恋的感觉
    2020-11-27 07:51

    No one else seems to have mentioned it, but within SQL Server you can also set up your view with the schemabinding attribute.

    This prevents modifications to any of the base tables (including dropping them) that would affect the view definition.

    This may be useful to you for some situations. I realise that I haven't exactly answered your question, but thought I would highlight it nonetheless.

提交回复
热议问题