为什么需要复制 'Views'?

Why 'Views' need to be replicated?

假设 View1 基于 Table A,B and C Server1。 Table A,B and C 使用事务复制复制到 Server2View1 创建于 Server2

提问:
那么两台服务器上的 View1 是否会反映相同的数据(扣除复制延迟)?
如果他们这样做,那么我们复制视图的其他原因是什么?
如果在发布者处更改了视图的脚本,这些更改会反映在订阅者上吗?

So will View1 on both the servers reflect the same data (discounting the replication delay)?

是的,一般视图查询基础表

If they do, then what are the other reasons we replicate Views?

简单来说,如果您希望访问 server2 的应用程序使用您的视图,您需要复制视图

If the script of a View is changed at Publisher, do the changes reflect on the subscriber?

是的,支持 DDL 更改..

来自 MSDN.

Replication supports a wide range of schema changes to published objects. When you make any of the following schema changes on the appropriate published object at a Microsoft SQL Server Publisher, that change is propagated by default to all SQL Server Subscribers:

ALTER TABLE
ALTER VIEW
ALTER PROCEDURE
ALTER FUNCTION
ALTER TRIGGER
ALTER TRIGGER can be used only for data manipulation language [DML] triggers because data definition language [DDL] triggers cannot be replicated.