Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 2.67 KB

File metadata and controls

63 lines (48 loc) · 2.67 KB
title sp_subscription_cleanup (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/03/2017
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology replication
ms.topic language-reference
f1_keywords
sp_subscription_cleanup_TSQL
sp_subscription_cleanup
helpviewer_keywords
sp_subscription_cleanup
ms.assetid bdc8aaa0-ff2d-40c2-84b2-4ba513ced279
author stevestein
ms.author sstein

sp_subscription_cleanup (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-xxxx-xxxx-xxx-md]

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

Syntax

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

Arguments

[ @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' [!INCLUDEssInternalOnly]

Return Code Values

0 (success) or 1 (failure)

Remarks

sp_subscription_cleanup is used in transactional and snapshot replication.

Permissions

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

See Also

sp_expired_subscription_cleanup (Transact-SQL)
sp_mergesubscription_cleanup (Transact-SQL)
System Stored Procedures (Transact-SQL)