Microsoft KB Archive/299649

= FIX: Merge Replication Agent Fails with Error Message: &quot;Unable to replicate a view or function&quot; =

Article ID: 299649

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q299649



BUG #: 234529 (SHILOH_BUGS)



SYMPTOMS
If you add a schema only article, such as a view or a stored procedure, to a merge publication without adding the referenced tables, the Merge Agent may fail and this error message occurs:

Error 208: Invalid object name 'object_name'.

Unable to replicate a view or function because the referenced objects or columns are not present on the Subscriber.

This behavior may also occur when you add the referenced table to the merge publication after you add the schema only article, and after generating an initial snapshot for the publication.



CAUSE
The sysmergeschemachange merge system table contains information about the published articles that are generated by the Snapshot Agent. When a referenced table is added after the schema only article, the schemaversion of the referenced table is higher than the schemaversion of the schema only article, which causes the error.



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 avoid this behavior when you add a view or stored procedure article to a merge publication, also add all the tables referenced by the view or stored procedure to the merge publication.



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
This problem only occurs when you add a schema only merge article such as a view or stored procedure. This behavior does not occur when you add a table merge article.

Steps to Reproduce Behavior
 Create a table named t1 (c1 int primary key,c2 int, c3 uniqueidentifier rowguidcol).  Create a view named t2 as: select * from t1                    Create a merge publication with t2 as an article. Run the Snapshot Agent.</li> Run the Merge Agent.</li> The Merge Agent fails with this error message:

Unable to replicate a view or function because the referenced objects or columns are not present on the Subscriber.

</li> Add t1 as an article to the merge publication.</li> Run the Snapshot Agent.</li> Run the Merge Agent.</li> The Merge Agent fails with this error message:

Unable to replicate a view or function because the referenced objects or columns are not present on the Subscriber.

</li></ol>

Keywords: kbbug kbfix kbsqlserv2000sp1fix KB299649

-

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

© Microsoft Corporation. All rights reserved.