Microsoft Knowledge Base Email Alertz

You do not receive an error message when you run the DBCC CHECKDB statement against a database in SQL Server, but an access violation occurs when you run a query on a table in the database

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 954467 - Last Review: June 25, 2008 - Revision: 1.0

You do not receive an error message when you run the DBCC CHECKDB statement against a database in SQL Server, but an access violation occurs when you run a query on a table in the database

Bug #: 443756 (SQLBUDT)

On This Page

SYMPTOMS

You create a table that contains indexes in Microsoft SQL Server 2000 or in Microsoft SQL Server 2005. When you run the DBCC CHECKDB statement against the database that contains this table, you do not receive an error message. However, when you run a query that references this table, an access violation occurs.

CAUSE

This problem occurs for many reasons. One reason is that the statistics group of a table index is corrupted. However, the DBCC CHECKDB statement does not detect a corrupted statistics group. Therefore, when the query optimizer loads a corrupted statistic group to determine the most efficient execution plan, an access violation occurs. Depending on the cause of the corrupted statistics group, the actual access violation may vary.

The following issues are some common causes of a corrupted statistics group:
  • The columns on which the database engine builds the statistics contain impure data.
  • Hardware problems exist.

WORKAROUND

To work around this problem, follow these steps:
  1. Determine whether the access violation is caused by a corrupted statistics group. To do this, run the DBCC SHOW_STATISTICS statement against all indexes on the tables that are referenced in the query.
  2. If an access violation occurs when you run one of these DBCC SHOW_STATISTICS statements, repair the statistics that cause the access violation. To repair the statistics, run the UPDATE STATISTICS statement against the corrupted statistics group.

    If no access violation occurs when you run these DBCC SHOW_STATISTICS statements, the access violation that you encountered when you ran the query may be unrelated to corrupted statistics. For more information, see the "More Information" section.

STATUS

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

MORE INFORMATION

More information about the DBCC SHOW_STATISTICS statement

The DBCC SHOW_STATISTICS statement raises an access violation only when the statistics group contains physical corruption.

The DBCC SHOW_STATISTICS statement does not raise an access violation if the statistics group contains logical corruption. However, if the query optimizer uses a statistics group that contains logical corruption, an access violation still occurs.

REFERENCES

For more information about the DBCC SHOW_STATISTICS statement, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn.microsoft.com/en-us/library/ms174384.aspx?s=1 (http://msdn.microsoft.com/en-us/library/ms174384.aspx?s=1)
For more information about the UPDATE STATISTICS statement, visit the following MSDN Web site:
http://msdn.microsoft.com/en-us/library/ms187348(SQL.100).aspx (http://msdn.microsoft.com/en-us/library/ms187348(SQL.100).aspx)

APPLIES TO
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Workgroup Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2000 Enterprise Edition
  • Microsoft SQL Server 2000 Developer Edition
  • Microsoft SQL Server 2000 Personal Edition
  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2000, Workgroup Edition
Keywords: 
kbtshoot kbsql2005engine kbexpertiseadvanced kbbug KB954467
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate