Microsoft KB Archive/867880

= FIX: Merge Agent may fail with an &quot;Invalid character value for cast specification&quot; error message =

Article ID: 867880

Article Last Modified on 11/2/2007

-

APPLIES TO


 * Microsoft SQL Server 2000 Service Pack 3
 * Microsoft SQL Server 2000 Service Pack 3
 * Microsoft SQL Server 2000 Service Pack 3
 * Microsoft SQL Server 2000 Personal Edition Service Pack 3
 * Microsoft SQL Server 2000 Service Pack 3
 * Microsoft SQL Server 2000 Workgroup Edition
 * Microsoft SQL Server 2000 Desktop Engine
 * Microsoft SQL Server 2000 Developer Edition
 * Microsoft SQL Server 2000 Enterprise Edition 64-bit

-



Bug #: 471622 (SHILOH_BUGS)



Microsoft distributes Microsoft SQL Server 2000 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 2000 hotfix release.



SYMPTOMS
The Merge Agent may fail while it enumerates changes and you may receive the following error message:

 Downloading data changes to the Subscriber Processing article 'MyArticle' The process could not enumerate changes at the 'Publisher'. Category:NULL Source: Merge Replication Provider Number: -2147200999 Message: The process could not enumerate changes at the 'Publisher'. Category:SQLSERVER Source: MyServer Number: 0 Message: Invalid character value for cast specification

The following conditions must be present for the problem to occur:
 * One article participates in more than one publication.
 * The article is vertically filtered within one publication and the same article has no filters in other publications.



Service pack information
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 How to obtain the latest SQL Server 2000 service pack

Hotfix information
The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.   Date         Time   Version        Size    File name --  19-Jun-2004  00:51  2000.80.952.0    664,128  Autoplt.dll 19-Jun-2004 00:51  2000.80.952.0     78,400  Console.exe 19-Jun-2004 00:51  2000.80.952.0    315,968  Custtask.dll 19-Jun-2004 00:51  2000.80.952.0     33,340  Dbmslpcn.dll 08-Apr-2004 21:42                   786,432  Distmdl.ldf 08-Apr-2004 21:42                 2,359,296  Distmdl.mdf 10-Oct-2003 18:48                       180  Drop_repl_hotfix.sql 19-Jun-2004 00:51  2000.80.952.0  1,905,216  Dtspkg.dll 19-Jun-2004 00:52  2000.80.952.0    528,960  Dtspump.dll 19-Jun-2004 00:52  2000.80.952.0  1,557,052  Dtsui.dll 19-Jun-2004 00:52  2000.80.952.0    639,552  Dtswiz.dll 10-Oct-2003 18:48                   747,927  Instdist.sql 10-Oct-2003 18:48                     1,581  Inst_repl_hotfix.sql 19-Jun-2004 00:51  2000.80.952.0    352,828  Isqlw.exe 19-Jun-2004 00:51  2000.80.952.0     82,492  Itwiz.exe 19-Jun-2004 00:52  2000.80.952.0     90,692  Msgprox.dll 19-May-2004 23:43  8.11.40209.0     209,408  Mssdi98.dll 19-Jun-2004 00:52  2000.80.952.0     62,024  Odsole70.dll 19-Jun-2004 00:52  2000.80.952.0     25,144  Opends60.dll 19-Jun-2004 00:51  2000.80.952.0     57,904  Osql.exe 19-Jun-2004 00:52  2000.80.952.0    279,104  Pfutil80.dll 10-Oct-2003 18:37                   550,780  Procsyst.sql 08-Apr-2004 21:42                    12,305  Qfe469315.sql 08-Apr-2004 21:42                    19,195  Qfe469571.sql 15-Jun-2004 18:11                 1,105,167  Replmerg.sql 19-Jun-2004 00:52  2000.80.952.0    221,768  Replprov.dll 19-Jun-2004 00:52  2000.80.952.0    307,784  Replrec.dll 15-Jun-2004 15:43  2000.80.952.0    159,813  Replres.rll 10-Oct-2003 18:48                 1,087,150  Replsys.sql 10-Oct-2003 18:48                   986,603  Repltran.sql 19-Jun-2004 00:52  2000.80.952.0    287,304  Rinitcom.dll 19-Jun-2004 00:52  2000.80.952.0     78,416  Sdiclnt.dll 19-Jun-2004 00:52  2000.80.952.0     66,112  Semmap.dll 19-Jun-2004 00:52  2000.80.952.0     57,916  Semnt.dll 19-Jun-2004 00:52  2000.80.952.0    492,096  Semobj.dll 15-Jun-2004 16:18  2000.80.952.0    172,032  Semobj.rll 19-Jun-2004 00:51  2000.80.952.0     53,832  Snapshot.exe 12-Mar-2004 03:10                   117,834  Sp3_serv_uni.sql 19-Jun-2004 00:51  2000.80.952.0     28,672  Sqlagent.dll 19-Jun-2004 00:51  2000.80.952.0    311,872  Sqlagent.exe 19-Jun-2004 00:51  2000.80.952.0    168,001  Sqlakw32.dll 19-Jun-2004 00:52  2000.80.952.0     33,344  Sqlctr80.dll 19-Jun-2004 00:52  2000.80.952.0  4,215,360  Sqldmo.dll 19-Jun-2004 00:51                    25,172  Sqldumper.exe 15-Jun-2004 15:26  2000.80.952.0     28,672  Sqlevn70.rll 19-Jun-2004 00:52  2000.80.952.0    180,792  Sqlmap70.dll 19-Jun-2004 00:52  2000.80.952.0    188,992  Sqlmmc.dll 15-Jun-2004 16:25  2000.80.952.0    479,232  Sqlmmc.rll 19-Jun-2004 00:52  2000.80.952.0    401,984  Sqlqry.dll 19-Jun-2004 00:52  2000.80.952.0     57,920  Sqlrepss.dll 19-Jun-2004 00:52  2000.80.952.0  7,581,777  Sqlservr.exe 19-Jun-2004 00:52  2000.80.952.0    590,396  Sqlsort.dll 19-Jun-2004 00:52  2000.80.952.0     45,644  Sqlvdi.dll 19-Jun-2004 00:52  2000.80.952.0    106,588  Sqsrvres.dll 19-Jun-2004 00:52  2000.80.952.0     33,340  Ssmslpcn.dll 19-Jun-2004 00:52  2000.80.952.0     82,492  Ssnetlib.dll 19-Jun-2004 00:52  2000.80.952.0     25,148  Ssnmpn70.dll 19-Jun-2004 00:52  2000.80.952.0    123,456  Stardds.dll 19-Jun-2004 00:52  2000.80.952.0    158,240  Svrnetcn.dll 19-Jun-2004 00:51  2000.80.952.0     76,416  Svrnetcn.exe 19-Jun-2004 00:52  2000.80.952.0     53,808  Ums.dll 19-Jun-2004 00:52  2000.80.952.0     98,872  Xpweb70.dll Note Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

This problem was first corrected in Microsoft SQL Server 2000 Service Pack 4.



MORE INFORMATION
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

Beginning with SQL Server 2000 hotfix build 8.00.798, performance enhancements were made to the Merge Agent. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

817464 FIX: Using Sp_executesql in Merge Agent operations

A new stored procedure that is named sp_MSenumchanges_direct was introduced to improve Merge Agent performance. Beginning with the 8.00.0798 hotfix, the sp_MSenumchanges procedure calls the sp_MSenumchanges_direct procedure if the following conditions are true:
 * 1) The user has select permissions on a table.
 * 2) No vertical filters are present in an article in any publication.
 * 3) The table has no computed or timestamp columns.
 * 4) The number of generations is not so high that the value of the @genlist parameter for the sp_MSenumchanges procedure would be more than 2,000 characters.

Before the 8.00.0798 hotfix, if one or more of these conditions was not true, the sp_MSenumchanges procedure called the sp_MSenumchanges_pal procedure.

The problem was that in condition 2, the Merge Agent did not check any publication except for the current publication. Also, the Merge Agent did not verify that condition 4 was true. This behavior caused the problem that is described in the &quot;Symptoms&quot; section. This hotfix makes the Merge Agent verify that all the four conditions are true.

Keywords: kbbug kbfix kbqfe kbsqlserv2000presp4fix kbhotfixserver KB867880

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.