Skip to content

Latest commit

 

History

History
53 lines (40 loc) · 2.96 KB

File metadata and controls

53 lines (40 loc) · 2.96 KB
title sp_expired_subscription_cleanup (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/14/2017
ms.prod sql
ms.prod_service database-engine
ms.reviewer
ms.technology replication
ms.topic language-reference
f1_keywords
sp_expired_subscription_cleanup
SP_EXPIRED_SUBSCRIPTION_CLEANUP_TSQL
helpviewer_keywords
sp_expired_subscription_cleanup
ms.assetid 6abc29fe-d77a-4673-9d99-ae31c688012c
author stevestein
ms.author sstein

sp_expired_subscription_cleanup (Transact-SQL)

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

Checks the status of all the subscriptions of every publication and drops those that have expired. This stored procedure is executed at the Publisher on any database or at the Distributor on the distribution database for a non- [!INCLUDEmsCoName] [!INCLUDEssNoVersion] Publisher.

Topic link icon Transact-SQL Syntax Conventions

Syntax

  
sp_expired_subscription_cleanup [ [ @publisher = ] 'publisher' ]   

Arguments

[ @publisher = ] 'publisher' Is the name of a non- [!INCLUDEssNoVersion] publisher. publication is sysname, with a default value of NULL. You should not specify this parameter for a [!INCLUDEssNoVersion] Publisher.

Return Code Values

0 (success) or 1 (failure)

Remarks

sp_expired_subscription_cleanup is used in all types of replication.

sp_expired_subscription_cleanup is executed by the Expired Subscription Clean Up job to detect and remove expired subscriptions from publication databases every 24 hours. If any of the subscriptions are out-of-date, that is, have not synchronized with the Publisher within the retention period, the publication is declared expired and the traces of the subscription are cleaned up at the Publisher. For more information, see Subscription Expiration and Deactivation.

Permissions

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

See Also

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