category: agent source: <publisher>_<db>_<2> (agent name) Number: 22017 error message: The process could not set the last distributed transaction
This error occurs with sp_repldone or sp_replcmds when tables with text/image datatypes are replicated and SELECT operations are performed on the text/image columns.
SELECT operations on text/image datatype columns log the retrieval of Text Pointer for the text/image data for every row it scans to get the results of the SELECT statement. This causes logging of Text pointer information for all the rows scanned and can cause excessive logging. Logreader scans through all these records and correctly finds that there is no replicated transaction. However, the time it can take to scan the log can cause the timeout message to be sent to the logreader.
You can use either of these workarounds:
Avoid SELECT statements on text/image datatypes on tables participating in replication. Alternately, you can use triggers to populate a shadow table in the same database and replicate this shadow table. This avoids the problem if you have SELECTs happening on the original table.
Increase the Query timeout (default: 300 seconds) on the logreader by editing the QueryTimeout option of the logreader agent. Refer to the SQL Server Books Online for details on editing options of replication agents.
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
254561 INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.