Resynchronizes the subscription.
sp_reinitsubscription [[@publication =] 'publication'] [,[@article =] 'article'],
{[@subscriber =] 'subscriber'} [,[@destination_db =] 'destination_db']
0 (success) or 1 (failure)
sp_reinitsubscription is used in transactional replication.
For auto_sync subscriptions on a publication that does not allow immediate-updating subscriptions, the Snapshot Agent must be run to prepare schema and bulk copy program files for the Distribution Agents to resynchronize the Subscribers after this stored procedure is executed.
For auto_sync subscriptions on a publication that allows immediate-updating subscriptions, the Distribution Agents resynchronize the Subscriber using the most up-to-date schema and bulk copy program files created by the Snapshot Agent before this stored procedure is executed. The Distribution Agent resynchronizes the Subscriber immediately after the user executes the stored procedure if the Distribution Agent is not busy; otherwise, it may happen after the message interval (specified by Distribution Agent command-prompt parameter: MessageInterval).
For no_sync subscriptions, it is up to the user to make sure that the destination tables at the Subscriber are in synchronization and there are no undelivered replication commands for the Subscriber pending before executing this stored procedure.
To resynchronize anonymous Subscribers on a publication, pass in all or NULL as subscriber.
Only members of the sysadmin fixed server role, members of the db_owner fixed database role, or the creator of the subscription can execute sp_reinitsubscription.
System Stored Procedures |