Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
sp_expired_subscription_cleanup (Transact-SQL)
Collapse the table of content
Expand the table of content

sp_expired_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).

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-Microsoft SQL Server Publisher.

Topic link icon Transact-SQL Syntax Conventions

sp_expired_subscription_cleanup [ [ @publisher = ] 'publisher' ] 

[ @publisher= ] 'publisher'

Is the name of a non-SQL Server publisher. publication is sysname, with a default value of NULL. You should not specify this parameter for a SQL Server Publisher.

0 (success) or 1 (failure)

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.

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

Community Additions

ADD
Show:
© 2015 Microsoft