DistributionDatabase.CleanUpAnonymousSubscription(Int32, PublicationType) DistributionDatabase.CleanUpAnonymousSubscription(Int32, PublicationType) Method


Removes metadata for anonymous subscriptions at the Distributor.

 void CleanUpAnonymousSubscription(int agentId, Microsoft::SqlServer::Replication::PublicationType publicationType);
public void CleanUpAnonymousSubscription (int agentId, Microsoft.SqlServer.Replication.PublicationType publicationType);
Int32 Int32

An Int32 value that specifies the agent ID value.

PublicationType PublicationType

A PublicationType object value that specifies the publication type.


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