Share via


PublisherMonitor.EnumDatabaseSubscriptions Method

Definition

Returns information on subscriptions that belong to publications that use a specified publication database.

public:
 System::Data::DataSet ^ EnumDatabaseSubscriptions(System::String ^ publicationDatabase, Microsoft::SqlServer::Replication::PublicationType publicationType, Microsoft::SqlServer::Replication::SubscriptionResultOption resultOption);
public System.Data.DataSet EnumDatabaseSubscriptions (string publicationDatabase, Microsoft.SqlServer.Replication.PublicationType publicationType, Microsoft.SqlServer.Replication.SubscriptionResultOption resultOption);
member this.EnumDatabaseSubscriptions : string * Microsoft.SqlServer.Replication.PublicationType * Microsoft.SqlServer.Replication.SubscriptionResultOption -> System.Data.DataSet
Public Function EnumDatabaseSubscriptions (publicationDatabase As String, publicationType As PublicationType, resultOption As SubscriptionResultOption) As DataSet

Parameters

publicationDatabase
String

Name of the publication database.

publicationType
PublicationType

Type of publication.

resultOption
SubscriptionResultOption

A SubscriptionResultOption value that specifies the result options.

Returns

A DataSet object that has the following columns.

Column name Data type Description
statusint Maximum status of all replication agents associated with the publication, which can be one of these values:

1 = Started

2 = Succeeded

3 = In progress

4 = Idle

5 = Retrying

6 = Failed

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

1 = expiration – a subscription to a transactional publication has not been synchronized within the retention period threshold.

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 not been synchronized within the retention period threshold.

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

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

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

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

subscribersysname Is the name of the Subscriber.
subscriber_dbsysname Is the name of the database used for the subscription.
publisher_dbsysname Is the name of the publication database.
publicationsysname Is the name of a publication.
publication_typeint Is the type of publication, which can be one of these values:

0 = Transactional publication

1 = Snapshot publication

2 = Merge publication

subtypeint Is the subscription type, which can be one of the following values:

0 = Push

1 = Pull

2 = Anonymous

latencyint The highest latency, in seconds, for data changes propagated by the Log Reader or Distribution Agents for a transactional publication.
latencythresholdint Is the maximum latency for the transactional publication above which a warning is raised.
agentnotrunningint Is the length of time, in hours, during which the agent has not run.
agentnotrunningthresholdint Is the length of time, in hours, that the agent has not run before a warning is raised.
timetoexpiration int Is the length of time, in hours, before the subscription expires if not synchronized.
expirationthresholdint Is the time, in hours, before the subscription expires that a warning is raised.
last_distsyncdatetime Is the date and time that the Distribution Agent last ran.
distribution_agentnamesysname Is the name of the Distribution Agent job for the subscription to a transactional publication.
mergeagentnamesysname Is the name of the Merge Agent job for the subscription to a merge publication.
mergesubscriptionfriendlynamesysname Is the friendly name given to the subscription.
mergeagentlocationsysname Is the name of the server on which the Merge Agent runs.
mergeconnectiontypeint Connection used when synchronizing a subscription to a merge publication, which can be one of the following values:

1 = local area network (LAN)

2 = dial-up network connection

3 = Web synchronization.

mergePerformanceint Performance of the last synchronization compared to all synchronizations for the subscription. This is based on the delivery rate of the last synchronization divided by the average of all previous delivery rates.
mergerunspeedfloat Is the delivery rate of the last synchronization for the subscription.
mergerundurationint Is the length of time to complete the last synchronization of the subscription.
monitorrankingint Is the ranking value used to order the subscriptions in the result set, and can be one of these values.

For a transactional publication:

60 = Error

56 = Warning: performance critical

52 = Warning: expiring soon or expired

50 = Warning: subscription uninitialized

40 = Retrying failed command

30 = Not running (success)

20 = Running (starting, running, or idle)

For a merge publication:

60 = Error

56 = Warning: performance critical

54 = Warning: long-running merge

52 = Warning: expiring soon or expired

50 = Warning: subscription uninitialized

40 = Retrying failed command

30 = Running (starting, running, or idle)

20 = Not running (success)

distributionagentjobidbinary(16) ID of the Distribution Agent job for subscriptions to a transactional publication.
mergeagentjobidbinary(16) ID of the Merge Agent job for subscriptions to a merge publication.
distributionagentidint ID of the Distribution Agent job for the subscription.
distributionagentprofileidint ID of the agent profile used by the Distribution Agent.
mergeagentidint ID of the Merge Agent job for the subscription.
mergeagentprofileidint ID of the agent profile used by the Merge Agent.

Remarks

The EnumDatabaseSubscriptions method can only be called by members of the db_owner or replmonitor fixed database roles on the distribution database.

Calling EnumDatabaseSubscriptions is equivalent to executing sp_replmonitorhelpsubscription.

Applies to