sp_subscription_cleanup (Transact-SQL)
Collapse the table of content
Expand the table of content

sp_subscription_cleanup (Transact-SQL)

Applies To: SQL Server 2014, SQL Server 2016 Preview

Topic Status: Some information in this topic is preview and subject to change in future releases. Preview information describes new features or changes to existing features in Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2).

Removes metadata when a subscription is dropped at a Subscriber. For a synchronizing transaction subscription, it also includes immediate-updating triggers. This stored procedure is executed at the Subscriber on the subscription database.

Topic link icon Transact-SQL Syntax Conventions

sp_subscription_cleanup [ @publisher = ] 'publisher' 
        , [ @publisher_db = ] 'publisher_db'
    [ , [ @publication = ] 'publication']
    [ , [ @reserved = ] 'reserved']

[ @publisher=] 'publisher'

Is the name of the Publisher. publisher is sysname, with no default.

[ @publisher_db=] 'publisher_db'

Is the name of the Publisher database. publisher_db is sysname, with no default.

[ @publication=] 'publication'

Is the name of the publication. publication is sysname, with a default of NULL. If NULL, subscriptions using a shared agent publication in the publishing database will be deleted.

[ @reserved=] 'reserved'

Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.

0 (success) or 1 (failure)

sp_subscription_cleanup is used in transactional and snapshot replication.

Only members of the sysadmin fixed server role or the db_owner fixed database role can execute sp_subscription_cleanup.

Community Additions

© 2015 Microsoft