如何从代码获取复制状态 [英] How to get replication status from code
问题描述
我已经在SQL Server 2005数据库上完成了复制。
现在我想从我的GUI中显示状态。(可以是C#或其他方式)
I have done replication on my SQL Server 2005 database. Now i want to show the status from my GUI.(Can be C# or else)
是否可以通过任何方法或API监视复制状态。
这是供客户确认复制是否正常。
Is there is any method or API by which i can monitor the status of replication. This is for client confirmation that replication is working.
谢谢
推荐答案
一个很好的选择是:如何以编程方式监视复制(通过T-SQL):
< a href = http://msdn.microsoft.com/en-us/library/ms147874(SQL.90).aspx rel = nofollow> http://msdn.microsoft.com/en-us/library /ms147874(SQL.90).aspx
A great option is this: How to Programmatically Monitor Replication (via T-SQL): http://msdn.microsoft.com/en-us/library/ms147874(SQL.90).aspx
下面是适用于任何人的SQL Server 2008 R2版本:
http://msdn.microsoft.com/en-us/library/ ms147874(SQL.100).aspx
And here's the SQL Server 2008 R2 version for anyone looking at this as well: http://msdn.microsoft.com/en-us/library/ms147874(SQL.100).aspx
在T-SQL中使用这些特殊过程可能会有些痛苦(因为您通常会想要将其输出导出到临时表或表变量中以对其进行过滤 ),但是大多数开发人员会发现这种交互比使用RMO更容易处理。
Using these special procedures can be a tiny bit of a pain from within T-SQL (as you'll commonly want to export their output into temp tables or table variables to 'filter it' an additional bit or what-not), but most devs will find this kind of interaction MUCH easier to deal with than using RMOs.
这篇关于如何从代码获取复制状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!