What are the pros/cons of using a synonym vs. a view?

后端 未结 7 1803
余生分开走
余生分开走 2020-12-05 06:53

This is a generic database design question - What are the benefits of using a synonym in database development, over a simple view? What are the main considerations to keep

相关标签:
7条回答
  • 2020-12-05 07:23

    A view primarily is a simple/complex "select" statement. Essentially you use a view as a mask, and show only those column values which are of use. You use a view with an intention to not show extra information to the end-user.

    Whereas a synonym is an alternative name for the database objects.

    • it allows you to use tables in other schema without prefixing the schema name in the table name with a dot as in (user.tab_name can be replaced by some_synonym_name)
    • you are not interested to share the actual object with others,
    0 讨论(0)
提交回复
热议问题