FIX: "Expression: (pCopySrc - command) <= (int) cmdLength" error when you add a column to a table published in a transactional publication in SQL Server 2008 R2

Article translations Article translations
Article ID: 2518808 - View products that this article applies to.
Expand all | Collapse all
Microsoft distributes Microsoft SQL Server 2008 R2 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 fix release.

SYMPTOMS

Consider the following scenario:
  • You create a transactional publication in SQL Server 2008 R2.
  • You add a table as an article to the publication.
  • You initialize the transactional publication, and you generate the initial snapshot.
  • You try to run a query to add a new column to the table.

    For example, you try to run the following query to add the <column name> column to the <table name> table:
    Alter table <table name> add <column name> int null
In this scenario, the query does not run, and you receive an error message that resembles the following:
Location: replschema.cpp:1305
Expression: (pCopySrc - command) <= (int) cmdLength
SPID: <Spid>
Process ID: <Process ID>

Msg 4902, Level 16, State 1, Line 2
Cannot find the object <table name> because it does not exist or you do not have permissions.
When this issue occurs, the following error message is logged in the SQL Server error log file.
Or, you may encounter the following slightly-different error:
Msg 3624, Level 20, State 1, Procedure sp_replflush, Line 1
A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a QFE from Technical Support.
Additionally, the following entries are logged in the error log:
2011-03-25 08:56:14.71 spid55 Error: 17066, Severity: 16, State: 1.
2011-03-25 08:56:14.71 spid55 SQL Server Assertion: File: <replschema.cpp>, line=1305 Failed Assertion = '(pCopySrc - command) <= (int) cmdLength'. This error may be timing-related. If the error persists after rerunning the statement, use DBCC CHECKDB to check the database for structural integrity, or restart the server to ensure in-memory data structures are not corrupted.

2011-03-25 08:56:14.92 spid55 Error: 3624, Severity: 20, State: 1.
2011-03-25 08:56:14.92 spid55 A system assertion check has failed. Check the SQL Server error log for details. Typically, an assertion failure is caused by a software bug or data corruption. To check for database corruption, consider running DBCC CHECKDB. If you agreed to send dumps to Microsoft during setup, a mini dump will be sent to Microsoft. An update might be available from Microsoft in the latest Service Pack or in a QFE from Technical Support.

RESOLUTION

Cumulative update information

SQL Server 2008 R2 Service Pack 1

The fix for this issue was first released in Cumulative Update 1 for SQL Server 2008 R2 Service Pack 1. For more information about how to obtain this cumulative update package, click the following article number to view the article in the Microsoft Knowledge Base:
2544793 Cumulative Update package 1 for SQL Server 2008 R2 Service Pack 1
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2567616 The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 Service Pack 1 was released


SQL Server 2008 R2

The fix for this issue was first released in Cumulative Update 7. For more information about how to obtain this cumulative update package for SQL Server 2008 R2, click the following article number to view the article in the Microsoft Knowledge Base:
2507770 Cumulative Update package 7 for SQL Server 2008 R2
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
981356 The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 was released

WORKAROUND

To work around this issue, modify the table name to contain less than 8 characters.

STATUS

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

Properties

Article ID: 2518808 - Last Review: July 18, 2011 - Revision: 2.0
APPLIES TO
  • Microsoft SQL Server 2008 R2 Datacenter
  • Microsoft SQL Server 2008 R2 Developer
  • Microsoft SQL Server 2008 R2 Enterprise
  • Microsoft SQL Server 2008 R2 Express
  • Microsoft SQL Server 2008 R2 Standard
Keywords: 
kbqfe kbexpertiseadvanced kbsurveynew kbfix KB2518808

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com