When should database synonyms be used?

后端 未结 6 1532
借酒劲吻你
借酒劲吻你 2021-02-03 20:59

I\'ve got the syntax down but I\'m wondering if somebody can provide an illustrative use case where database synonyms are very useful.

6条回答
  •  无人共我
    2021-02-03 21:59

    It is excellent for staging mock tables when testing. For example, if your source tables contain millions of records and you want to test a small subset of data, you can use synonyms to re-direct the source table to a smaller table you control so you can stage various scenarios.

    In this way, you can update/delete the data in the mock table without affecting your source table. When you are ready to use the source table, all you need to do is re-direct the synonym.

提交回复
热议问题