FIX: Transaction Log of Snapshot Published Database Cannot Be Truncated

This article was previously published under Q306769
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 354981 (SHILOH_BUGS)
The transaction log of a database, with a snapshot publication, does not truncate if the database is also a Subscriber to a transactional replication publication. The capability to truncate the log should exist because the publication is a snapshot publication. When an attempt to truncate the transaction log occurs, the following error message displays because the publication is a snapshot publication and there is no Log Reader Agent:
The log was not truncated because records at the beginning of the log are pending replication. Ensure the Log Reader Agent is running or use sp_repldone to mark transactions as distributed.
To support loop-back detection in bi-directional replication, the Distribution Agent logs the originator information at the Subscriber for each transaction it commits. This is done by calling a server side stored procedure, sp_replsetoriginator. Inside the sp_replsetoriginator stored procedure, the program checks to see whether the database is published. If the database is not published, then you know it cannot be part of a bi-directional setup, and you do not need to do anything. If the database is published, the program writes a log record with the originator server and database name so that the Log Reader Agent can pick it up and populate replication commands in the distribution database with the information.

While the logic works as expected, there is a problem when bi-directional replication is not used and the Subscriber is also a Publisher for a snapshot publication. In this case, the Subscription database is still marked as published and the Distribution Agent writes these records to the transaction log. This means that the transaction log does not truncate unless you manually invoke a sp_repldone stored procedure from time to time.
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack


NOTE: The following hotfix was created prior to Microsoft SQL Server 2000 Service Pack 2.

The English version of this fix should have the following file attributes or later:
  File name   Platform  --------------------  S80433i.exe  Intel
NOTE: Due to file dependencies, the most recent hotfix or feature that contains the preceding files may also contain additional files.

To work around this problem either:
  • Run the sp_repldone stored procedure in the database with the snapshot publication (manually or scheduled).


  • Use Data Transformation Services (DTS) instead of a snapshot publication to transfer the database to another server.
Microsoft has confirmed this to be a problem in SQL Server 2000. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.

Article ID: 306769 - Last Review: 01/16/2015 23:23:34 - Revision: 3.1

  • Microsoft SQL Server 2000 Standard Edition
  • kbnosurvey kbarchive kbbug kbfix kbsqlserv2000presp2fix KB306769