Updates the record that identifies the server’s last distributed transaction.
sp_repldone [@xactid =] xactid, [@xact_seqno =] xact_seqno
[,[@numtrans =] numtrans] [,[@time =] time [,[@reset =] reset]
0 (success) or 1 (failure)
sp_repldone is used in transactional replication.
sp_repldone is used by the log reader process to track which transactions have been distributed.
Caution If you execute sp_repldone manually, you can invalidate the order and consistency of delivered transactions.
With sp_repldone, you can manually tell the server that a transaction has been replicated (sent to the Distributor). It also allows you to change the transaction marked as the next one awaiting replication. You can move forward or backward in the list of replicated transactions. (All transactions less than or equal to that transaction are marked as distributed.)
The required parameters xactid and xact_seqno can be obtained by using sp_repltrans or sp_replcmds.
Members of the sysadmin fixed server role or the db_owner fixed database role can execute sp_repldone.
When xactid is NULL, xact_seqno is NULL, and reset is 1, all replicated transactions in the log are marked as distributed. This is useful when there are replicated transactions in the transaction log that are no longer valid and you want to truncate the log, for example:
EXEC sp_repldone @xactid = NULL, @xact_segno = NULL, @numtrans = 0, @time = 0, @reset = 1
Caution This procedure can be used in emergency situations to allow truncation of the transaction log when transactions pending replication are present. Using this procedure prevents Microsoft® SQL Server™ from replicating the database until the database is unpublished and republished.
sp_replcmds | sp_repltrans |
sp_replflush | System Stored Procedures |