Snapshot or Logreader agents fail when destination table is empty in SQL Server

Symptoms

In a transactional replication in Microsoft SQL Server, an article in an SQL query has an empty string in a destination table (@destination_table = N"") in a Transact-SQL statement. In this situation, you may receive the following error messages in the specified locations:
  • In the Snapshot agent:
    Value cannot be null.Parameter name: strObjectName

  • In the Logreader agent:
    The process could not execute 'sp_replcmds' on 'SERVER'

  • In the error log file:
    SQL Server Assertion: File: <replrowset.cpp>, line=2853 Failed Assertion = 'dwColLen'.

    Note This error may be timing-related. If the error persists after you rerun the statement, use DBCC CHECKDB to check the database for structural integrity. Or, restart the server to make sure that in-memory data structures are not corrupted. A dump file is created in the \Log folder that contains the details of the assertion.

Note The second and third errors are triggered only if publication has the immediate sync option enabled.

Cause

This issue occurs because an empty string is not a valid destination table name.

Workaround

To work around this issue, set a valid destination table name, or remove the invalid destination table name.
Properties

Article ID: 3144065 - Last Review: Apr 5, 2016 - Revision: 1

Feedback