FIX: Replication Snapshot Agent May Fail with Access Violation Error When A Long Filter Clause is Used

Article translations Article translations
Article ID: 243504 - View products that this article applies to.
This article was previously published under Q243504
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 55635 (SQLBUG_70)
Expand all | Collapse all

Symptoms

When you use transactional replication, if the publication article uses a filter clause longer than 129 characters, then the snapshot agent may fail with this message in the agent history:
An Access Violation occurred. The Step failed.

Workaround

Use View object to shorten the length of the filter clause to 129 characters or less.

Status

Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
254561 INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.

More information

The example that follows demonstrates this behavior.

Suppose you have a table named Orders in the publication and you define a horizontal filter on this table as:
Select * from Orders where Orders.emp_id in (select emp_id from Employees inner join Permanent_Employees on Employees.emp_id = Permanent_Employees.emp_id where Employees.emp_id = '10' )
				
This filter clause may cause the Snapshot agent to generate an access violation error because the filter clause exceeds 129 characters in length.

To avoid this error create a View object by using the view in your filter clause:
Create View V_Orders as Employees inner join Permanent_Employees on Employees.emp_id = Permanent_Employees.emp_id where Employees.emp_id = '10' 
				
You can then filter the Orders table with this condition:
Select * from Orders where Orders.emp_id in (select emp_id from V_Orders )
				
This filter clause design avoids the access violation behavior.

Properties

Article ID: 243504 - Last Review: November 2, 2013 - Revision: 3.0
Applies to
  • Microsoft SQL Server 7.0 Standard Edition
Keywords: 
kbnosurvey kbarchive kbbug kbfix KB243504

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