共用方式為


ReplicationMonitor.EnumPublishers2 Method

Returns a list of Publishers that use the currently connected server as the Distributor.

命名空間: Microsoft.SqlServer.Replication
組件: Microsoft.SqlServer.Rmo (in microsoft.sqlserver.rmo.dll)

語法

'宣告
Public Function EnumPublishers2 As DataSet
public DataSet EnumPublishers2 ()
public:
DataSet^ EnumPublishers2 ()
public DataSet EnumPublishers2 ()
public function EnumPublishers2 () : DataSet

傳回值

A DataSet object that contains the following columns.

Column

Data type

Description

publisher

String

Is the name of a Publisher.

distribution_db

String

Is the name of the distribution database used by a given Publisher.

status

Int32

Maximum status of all replication agents associated with publications at this Publisher, which can be one of these values.

1 = Started

2 = Succeeded

3 = In progress

4 = Idle

5 = Retrying

6 = Failed

warning

Int32

Maximum threshold warning generated by a subscription belonging to a publication at this Publisher, which can be the logical OR result of one or more of these values.

1 = Expiration. A subscription to a transactional publication has exceeded the retention period by more than the allowable threshold, as a percentage of the retention period.

2 = Latency. The time taken to replicate data from a transactional Publisher to the Subscriber exceeds the threshold, in seconds.

4 = Mergeexpiration. A subscription to a merge publication has exceeded the retention period by more than the allowable threshold, as a percentage of the retention period.

8 = Mergefastrunduration. The time taken to complete synchronization of a merge subscription exceeds the threshold over a fast network connection, in seconds.

16 = Mergeslowrunduration. The time taken to complete synchronization of a merge subscription exceeds the threshold over a slow or dial-up network connection, in seconds.

32 = Mergefastrunspeed. The delivery rate for rows during synchronization of a merge subscription has failed to maintain the threshold rate over a fast network connection, in rows per second.

64 = Mergeslowrunspeed. The delivery rate for rows during synchronization of a merge subscription has failed to maintain the threshold rate over a slow or dial-up network connection, in rows per second.

publicationcount

Int32

Is the number of publications belonging to the Publisher.

備註

If a Distributor is not installed or the distribution database is not created, this method throws an exception.

The EnumPublishers2 method can only be retrieved by members of the sysadmin fixed server role at the Distributor or by members of the db_owner or replmonitor fixed database roles on the distribution database.

Calling EnumPublishers2 is equivalent to executing sp_replmonitorhelppublisher (Transact-SQL).

The EnumPublishers2 method is available with SQL Server 2005.

This namespace, class, or member is supported only in version 2.0 of the .NET Framework.

執行緒安全性

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

開發平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

目標平台

如需受支援的平台清單,請參閱<安裝 SQL Server 2005 的硬體和軟體需求>。

請參閱

參考

ReplicationMonitor Class
ReplicationMonitor Members
Microsoft.SqlServer.Replication Namespace

其他資源

How to: Programmatically Monitor Replication (RMO Programming)