Microsoft KB Archive/299439

From BetaArchive Wiki
Knowledge Base


Article ID: 299439

Article Last Modified on 4/6/2004



APPLIES TO

  • Microsoft SQL Server 2000 Standard Edition



This article was previously published under Q299439

BUG #: 353192(SHILOH_BUGS)

SYMPTOMS

If a table that is being merge published has a ROWGUID column, and the ROWGUID field is not the last column in the table, the initial snapshot generation for a merge publication may fail and the following errors are logged in the snapshot output file:

      • [Publication:'snapshotfailtest'] Make generation time: 691 (ms) ***

SourceTypeId = 5
SourceName = SERVER1\NAMED1
ErrorCode = 50007
ErrorText = Line 326: Incorrect syntax near '-'.
Line 326: Incorrect syntax near '-'.
Repl Agent Status: 6
Disconnecting from Publisher 'SERVER1\NAMED1'


CAUSE

This problem occurs if:

  • The ROWGUID column is not the last column defined in the table schema.


-or-

  • The column name for the ROWGUID column contains an underscore "_" character.


RESOLUTION

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

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack


WORKAROUND

To work around this problem either:

  • Drop, and then re-create the table so that the ROWGUID column is the last column in the table definition.


-or-

  • Rename the column name for the ROWGUID column and remove the underscore "_".


STATUS

Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

MORE INFORMATION

To enable output logging for the Snapshot Agent, use these steps:

  1. Right-click the Snapshot Agent, and then click Agent Properties.
  2. Click Steps, and then edit the Run Agent Step.
  3. At the end of the command, add:


-Output C:\snapshotagent1.txt -Outputverboselevel 2

Note The higher the value for Outputverboselevel, the more amount of information is logged in detail. The values for Outputverboselevel are 1, 2, and 3.

  1. Click OK, and then rerun the Snapshot Agent. This creates the log file on the C: drive of the computer where the Snapshot Agent is being run.

Steps to Reproduce the Problem

  1. Use the following script to create the table:

    CREATE TABLE [dbo].[URLstest6] (
        [id] [int] IDENTITY (1, 1) NOT FOR REPLICATION  NOT NULL ,
        [id_guid]  uniqueidentifier ROWGUIDCOL  NOT NULL ,
        [core_id] [int] NULL
    ) ON [PRIMARY]
    GO
  2. Publish the table for Merge, and then run the Snapshot Agent.

    Immediately, the agent fails with the error message shown in the "Symptoms" section.
  3. Delete the publication, drop the table, and then modify the table script in step 1 so that the id_guid ROWGUID column is defined as the last field in the table schema.
  4. Re-create the publication, and then run the Snapshot Agent again. This time the problem does not occur.
  5. Drop the publication again, and then delete the table. Re-create the table by replacing the column name for the ROWGUID column with idguid instead of id_guid, and then generate the snapshot. Now the snapshot runs without any errors.



Additional query words: rowguid merge snapshot replication

Keywords: kbbug kbfix kbsqlserv2000sp1fix KB299439