共用方式為


DistributionDatabase.CleanUpAnonymousSubscription Method

Definition

Removes metadata for anonymous subscriptions at the Distributor.

public:
 void CleanUpAnonymousSubscription(int agentId, Microsoft::SqlServer::Replication::PublicationType publicationType);
public void CleanUpAnonymousSubscription (int agentId, Microsoft.SqlServer.Replication.PublicationType publicationType);
member this.CleanUpAnonymousSubscription : int * Microsoft.SqlServer.Replication.PublicationType -> unit
Public Sub CleanUpAnonymousSubscription (agentId As Integer, publicationType As PublicationType)

Parameters

agentId
Int32

An Int32 value that specifies the agent ID value.

publicationType
PublicationType

A PublicationType object value that specifies the publication type.

Remarks

Use the CleanUpAnonymousSubscription method to remove the metadata for anonymous subscriptions that have expired or that no longer exist. Otherwise, this metadata may be returned by Replication Monitor. You can also use the ExcludeAnonymousSubscriptions property to prevent anonymous subscription information from being returned. For more information, see Monitoring Replication.

The CleanUpAnonymousSubscription method can only be called by members of the db_owner fixed database role on the distribution database.

Applies to