基于合并冲突警报?

sql server

  • 在Facebook上分享
  • 在Twitter上分享
  • 分享在LinkedIn
  • 在Reddit分享
  • 通过电子邮件分享
  • 印刷资源

另一个有趣的问题出现在本周一个类。我们怎样才能自动基于冲突合并复制警觉?自动解决冲突,但最好是通过电子邮件通知,更新覆盖或至少记录。让我们来看看……合并冲突都存储在一个表称为MSMerge_Conflicts_Info系统表的发布和订阅数据库。ssm交互式冲突观众使用这个表展示如何解决冲突,并提供一个选项来提交失败者将失去更新转化为一个成功的更新和赢家输家。互动,可以做。只需右键单击合并出版并选择观点冲突。但是如果你想要一个提醒邮件发送基于冲突发生。你可以把一个插入触发器MSMerge_Conflicts_Info表使用RAISERROR日志信息消息Windows应用程序日志(日志)。 MSMerge_Conflicts_Info has a column called Reason_text that contains who won and lost. Based on the error code you define, you could then define a SQL Server Agent Alert based on that error and have an email sent using Database Mail. Voila. If you wanted more information about the losing data, you can look at the "MSmerge_conflict_publication_article" table for each article in the publication. SQL Server plugs in the publication and article name in the table name. These are the tables that the Conflict Viewer uses to display the winning and losing data. You can reference these tables in your trigger code. Now in general, I recommend designing conflicts out of the system by careful database design especially for replication. For instance, adding a column to the Primary Key such as a region code or similar will effectively "design away" conflicts. This is the conflict avoidance strategy. But if you do have to deal with conflict resolution, this is one way of keeping up to date with the results. And you can then turn a loser into a winner. Hmmm...this would be good in the NFL playoffs... cheers Brian Advanced Merge Replication Conflict Detection and Resolution: http://technet.microsoft.com/en-us/library/ms151257.aspx

相关:

版权©2010 IDG通信公司。Raybet2

企业网络2022的10个最强大的公司