sp_reinitsubscription (T-SQL)

Resynchronizes the subscription.

Syntax

sp_reinitsubscription [[@publication =] 'publication'] [,[@article =] 'article'],
    {[@subscriber =] 'subscriber'} [,[@destination_db =] 'destination_db']

Arguments
[@publication =] 'publication'
Is the name of the publication. publication is sysname, with a default of all.
[@article =] 'article'
Is the name of the article. article is sysname, with a default of all. For an immediate-updating publication, article must be all; otherwise, the stored procedure skips the publication and reports an error.
[@subscriber =] 'subscriber'
Is the name of the Subscriber. subscriber is sysname, with no default.
[@destination_db =] 'destination_db'
Is the name of the destination database. destination_db is sysname, with a default of all.
Return Code Values

0 (success) or 1 (failure)

Remarks

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.

Permissions

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.

See Also
System Stored Procedures  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.