Removes metadata such as triggers and entries in sysmergesubscription and sysmergearticles when a merge subscription is dropped at a Subscriber.
sp_mergesubscription_cleanup [@publisher =] 'publisher',
[@publisher_db =] 'publisher_db' [,[@publication =] 'publication']
0 (success) or 1 (failure)
sp_mergesubscription_cleanup is used in merge replication.
sp_mergesubscription_cleanup periodically checks the status of all the subscriptions of every merge publication. If any of them is out-of-date, that is, has lost contact with the Publisher for too long a period, the publication is declared expired and the traces of the subscription are cleaned up at the Publisher.
Only members of the sysadmin fixed server role or the db_owner fixed database role can execute sp_mergesubscription_cleanup.
sp_expired_subscription_cleanup | System Stored Procedures |
sp_subscription_cleanup |