FIX: An access violation occurs when you restore a database and run the sp_replcounters stored procedure at the same time on a server that is running SQL Server 2008 or SQL Server 2008 R2

Article translations Article translations
Article ID: 2535705 - View products that this article applies to.

Microsoft distributes Microsoft SQL Server 2008 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 SQL Server 2008 R2 fix release.
Expand all | Collapse all

On This Page

SYMPTOMS

Consider the following scenario:
  • You have one server that is running replication in a Microsoft SQL Server 2008 or in a Microsoft SQL Server 2008 R2 environment.
  • You have a second server that is running Microsoft SQL Server 2008 or Microsoft SQL Server 2008 R2, and replication is disabled or is not installed.
  • You restore a replicated database of the first server to the second server.
  • During the database restore process, a user or application runs the stored procedure sp_replcounters on the second server.

In this scenario, an access violation may occur on the second server. Additionally, a stack dump file is created in the SQL Server log folder. When this issue occurs, you may have to restart the second server.

CAUSE

This problem occurs because the stored procedure sp_replcounters runs on a server where replication is disabled or not installed. When sp_replcounters tries to access the article cache, the database restore operation has already called clear_db_repl_cache to remove the database from the article cache before the database is added back into the article cache.

RESOLUTION

Cumulative update information

SQL Server 2008 R2

The fix for this issue was first released in Cumulative Update 9. 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:
2567713 Cumulative Update package 9 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

SQL Server 2008 R2 Service Pack 1

The fix for this issue was first released in Cumulative Update 2 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:
2567714 Cumulative Update package 2 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

The fix for this issue was first released in Cumulative Update 4. For more information about how to obtain this cumulative update package for SQL Server 2008, click the following article number to view the article in the Microsoft Knowledge Base:
2527180 Cumulative update package 4 for SQL Server 2008 Service Pack 2
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 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:
956909 The SQL Server 2008 builds that were released after SQL Server 2008 was released

STATUS

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

MORE INFORMATION

For more information about what files are changed, and for information about any prerequisites to apply the cumulative update package that contains the hotfix that is described in this Microsoft Knowledge Base article, click the following article number to view the article in the Microsoft Knowledge Base:
2527180 Cumulative update package 4 for SQL Server 2008 Service Pack 2

REFERENCES

For more information about replication statistics, visit the following Microsoft Developer Network (MSDN) website:
sp_replcounters (Transact-SQL)
For more information about the list of builds that are available after the release of SQL Server 2008, click the following article number to view the article in the Microsoft Knowledge Base:
956909 The SQL Server 2008 builds that were released after SQL Server 2008 was released
For more information about the Incremental Servicing Model for SQL Server, click the following article number to view the article in the Microsoft Knowledge Base:
935897 An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems
For more information about the naming schema for SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:
822499 New naming schema for Microsoft SQL Server software update packages
For more information about software update terminology, 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

Properties

Article ID: 2535705 - Last Review: August 15, 2011 - Revision: 3.0
APPLIES TO
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 R2 Developer
  • Microsoft SQL Server 2008 R2 Enterprise
  • Microsoft SQL Server 2008 R2 Standard
Keywords: 
kbautohotfix kbqfe kbhotfixserver kbfix kbexpertiseinter kbsurveynew KB2535705

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