事务复制和触发器
假设 ServerA.TableA 被复制(通过事务复制)到 ServerB.TableA。如果 ServerB.TableA 上存在一个在插入或更新行时触发的触发器,那么当从 ServerA.TableA 复制行时该触发器是否会触发?
Say ServerA.TableA is replicated (via Transactional Replication) to ServerB.TableA. If a trigger existed on ServerB.TableA that fired when a row was inserted or updated, would the trigger fire as rows are replicated from ServerA.TableA?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这取决于触发器是如何创建的。
CREATE/ALTER TRIGGER
语句支持NOT FOR REPLICATION 子句:It depends on how the trigger was created.
CREATE/ALTER TRIGGER
statements support the NOT FOR REPLICATION clause:事务不是传送并应用到远程服务器(而不是行)吗?这会让我认为交易只是被应用,触发器实际上并未被触发,但结果被应用。
我不是这方面的专家——只是一个想法。
Aren't the transactions shipped and applied to the remote server - not rows? This would lead me to think that the transactions are simply applied and the trigger is not actually fired, but the results are applied.
I'm no expert on this - just an idea.