BUG: Error message when you replicate a table to a SQL Server destination by using snapshot replication in SQL Server 2000: "Bulk-copy commit failed (bcp_batch) ODBC message: SQLSTATE 37000, native error 4813" (922663)



The information in this article applies to:

  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2000 Developer Edition
  • Microsoft SQL Server 2000 Enterprise Edition
  • Microsoft SQL Server 2000 Workgroup Edition
  • Microsoft SQL Server 2000 Personal Edition

Bug #: 474952 (SQL Server 8.0)

SYMPTOMS

Consider the following scenario. In Microsoft SQL Server 2000, you replicate a table to a SQL Server destination by using snapshot replication. The table has a column of the text data type or of the image data type. In this scenario, you may experience one of the following symptoms if the column contains a null value or zero-length data:
  • The replication subscription fails, and you receive the following error message:
    Bulk-copy commit failed (bcp_batch). ODBC message: SQLSTATE 37000, native error 4813, [Microsoft][ODBC SQL Server Driver][SQL Server]Expected the text length in data stream for bulk copy of text, ntext, or image data.
  • The number of rows that are actually replicated does not match the number of rows that you expect to be replicated.

WORKAROUND

To work around this problem, specify a WHERE clause for the publication to filter out any null values or any zero-length data. To do this, follow these steps:
  1. Start SQL Server Enterprise Manager.
  2. Right-click the publication that contains the table.
  3. Click Properties.
  4. In the Publication Properties dialog box, click the Filter Rows tab.
  5. Double-click the article that contains the table.
  6. In the Specify Filter dialog box, enter a statement that resembles the following statement.
    SELECT <published_columns> FROM <TABLE> WHERE <YourColumnName> IS NOT NULL
Note When you use this workaround, the data in the other columns of the problematic row is no longer published.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

Modification Type:MajorLast Reviewed:8/17/2006
Keywords:kbExpertiseAdvanced kbtshoot kbBug KB922663 kbAudDeveloper kbAudITPRO